Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^3: Extracting text from a line

by almut (Canon)
on Jul 12, 2010 at 07:28 UTC ( #848938=note: print w/replies, xml ) Need Help??

in reply to Re^2: Extracting text from a line
in thread Extracting text from a line

What's the difference, semantically?

Note that in list context (my ($uid) = ...), the match operation returns the captures, so $uid holds the same value as $1.  If there is no match, both values are undef.

Replies are listed 'Best First'.
Re^4: Extracting text from a line
by pemungkah (Priest) on Jul 13, 2010 at 00:37 UTC
    Vivek, I strongly disagree with you here because of the fact that the number variables are very fragile: they are global to every pattern match.

    If someone else comes along and adds (for instance) a"harmless" subroutine call that sometimes does a pattern match of its own between the match and the usage of $1, then the results are unpredictable because the intervening match has reused the global variables.

    If you always capture the value in a separate variable immediately, you're safe from this potential bug.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://848938]
[shmem]: LanX can get the logs from cbstream at any time from me.
shmem relocates to the pub over the street. Have a nice time.
[LanX]: well .. not so much interested in reading this article
[LanX]: my 2 cents: AngloZionistic sounds like an antisemtic theory, but to be critical of zionism doesn't mean to be anti-semitic
[shmem]: it hasn't been coined as a *mustread* without authority from the promoter
erix shoots an anti-bubble missile towards LanX
[LanX]: I don't have the time to go into depth of this blog though
[LanX]: anti-bubble missile?

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2018-03-19 21:35 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (246 votes). Check out past polls.