Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: basic doubt

by Athanasius (Monsignor)
on Oct 27, 2012 at 04:05 UTC ( #1001159=note: print w/ replies, xml ) Need Help??


in reply to basic doubt

Hello vis29, and welcome to the Monastery!

The code shown applies the regex to whatever string is currently stored in the default variable $_, and if the regex matches it assigns the string "not recognized" to the scalar variable $uname.

The regex says:

  • ^ — starting at the beginning of the string
  • $hash — match the current value of the scalar variable $hash
  • followed by the literal string 'server'
  • and capture the word 'server' if a match is found.

I’m guessing that the code doesn’t do (anything like) what was intended, but without seeing the surrounding context it’s hard to say exactly what that was. Here is one guess:

$uname = "not recognized" unless exists $hash{server};

Hope that helps,

Athanasius <°(((><contra mundum


Comment on Re: basic doubt
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-08-28 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (256 votes), past polls