Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Bug in 'strict'??

by modred (Pilgrim)
on Apr 05, 2001 at 16:54 UTC ( [id://70072]=note: print w/replies, xml ) Need Help??


in reply to Bug in 'strict'??

I don't know if it is a bug in strict or not but you need to check to make sure that the match works before assigning $2 to anything. If the match fails then $localfilename will be empty and the open will fail.

Something like

my $localfilename; if($filename =~ m/(.*?$CGI::SL)*(.*)(?=$)/ ) { $localfilename = $2; } else { # handle the error however you need to }

Replies are listed 'Best First'.
Re: Re: Bug in 'strict'??
by Jouke (Curate) on Apr 05, 2001 at 16:56 UTC
    You're right modred (I could have predicted these replies of course), but it does match. That's not even the case. $localfilename gets a value from $2. Take that as true, but just by calling open() the value disappears.

    Jouke Visser, Perl 'Adept'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-20 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found