Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Bug in 'strict'??

by modred (Pilgrim)
on Apr 05, 2001 at 16:54 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2023-05-29 02:38 GMT
Find Nodes?
    Voting Booth?

    No recent polls found