LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-01-2006, 06:53 PM   #1
DanTaylor
Member
 
Registered: Jan 2006
Distribution: Debian Sarge
Posts: 265

Rep: Reputation: 30
Stupid problem - perl


Can anyone help me with this stupid error that for some reason I can't figure out?
perl code:

#$cmd is user input
use File::NCopy;
...
...
if ($cmd =~ /^burn/) {
if ($cmd =~ /^burn\s+-b/) {
#lots of burn code
}elsif ($cmd =~ /^burn\s+.*/ {
#Here is the problem(I think)

$cmd =~ s/burn\s+//;
@fls = split /\s+/, $cmd;

for (@fls) {

print "Copying $_\n";
copy $_, "/mydir/"
or die "You stupid perl noob! you can't even write simple code!\n $!\n";
}
}
}
 
Old 02-01-2006, 10:15 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Can you say what the prob is, and please use < code > < / code > tags around your code.
 
Old 02-02-2006, 01:39 PM   #3
aanbar
LQ Newbie
 
Registered: Jan 2006
Posts: 5

Rep: Reputation: 0
Hello ,

we have a problem here , you didn't write out the error you got

when you run this script plus it's not the complete source

i think you should be using warnings and strict in your code

which will help you alot
 
Old 02-02-2006, 03:01 PM   #4
DanTaylor
Member
 
Registered: Jan 2006
Distribution: Debian Sarge
Posts: 265

Original Poster
Rep: Reputation: 30
get back to you on the errors, I don't have access to my computer right now.
 
Old 02-02-2006, 03:06 PM   #5
peter_89
Member
 
Registered: Jan 2006
Distribution: Microsoft Windows XP Professional SP2; Slackware Linux 10.2
Posts: 215

Rep: Reputation: 30
Quote:
"You stupid perl noob! you can't even write simple code!\n $!\n"
It actually wrote that?
 
Old 02-03-2006, 10:41 AM   #6
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
does it compile?
does it fail at run-time?
 
Old 02-03-2006, 03:45 PM   #7
DanTaylor
Member
 
Registered: Jan 2006
Distribution: Debian Sarge
Posts: 265

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by peter_89
It actually wrote that?
Of course, I always have to insult myself while I'm programming.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stupid, stupid question; I lost Klaptop. :( Surfrider Slackware 2 08-31-2005 09:12 PM
Stupid problem k1ll3r_x Linux - Hardware 4 01-06-2005 08:21 AM
Problem with perl module for w3c validator to work on my local Apache+PHP+perl instal tbamt Linux - Software 0 12-16-2004 05:37 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM
perl: stupid question alert!!:) katana Programming 2 08-01-2001 10:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration