Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

•Re: perl + CGI's

by merlyn (Sage)
on Dec 13, 2002 at 15:42 UTC ( #219608=note: print w/replies, xml ) Need Help??


in reply to perl + CGI's

$file_contents =~ m/^.*(\\|/\)(.*)/; my $name = $2;
Never ever use $1 or $2 unless it's in the context of having tested whether the match worked or not.

Since that match could fail, you have no idea what's in $2 at this point. Could be from a previous match.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://219608]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2022-08-13 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?