Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: Re: Re: checking the end of line

by dimmesdale (Friar)
on Jul 20, 2002 at 14:04 UTC ( #183591=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: Re: checking the end of line
in thread checking the end of line

$1 captures 12, you are right. However, you do an array slice thing with the [0] part -- which on my machine perl 5.6.1 AS build 633 produces an error; I have to move the parentheses around the regex itself. And when you print it, it shows a 1 on my computer. I just don't see the need for the [0]


Comment on Re: Re: Re: Re: Re: checking the end of line
Select or Download Code
Re: Re: Re: Re: Re: Re: checking the end of line
by I0 (Priest) on Jul 20, 2002 at 17:17 UTC
    What error does it produce on your machine? On mine, the array slice is necessary to put the regex in list context so that it returns the captured string instead of the true or false value it returns in scalar context
      Syntax error becuase of )[

      With the parens around JUST the regex it works (but returns a 1).

      Assigning the results to an array or using the $1 variable, however, would get around this if the user is having any problems ...

      Has anyone else been having problems with PM? I checked my firewall, and it seems that the banners up top keep 'timing-out', so the whole page takes forever to load.

        If you're getting a syntax error, perhaps you typed it in wrong.

        Perhaps you meant
        if($path =~ /(\d+)$/ == 0) { print "No number found\n"; } else { print "number is $1\n"; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2014-07-28 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (190 votes), past polls