Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Can someone explain this one to me?

by CheeseLord (Deacon)
on Jun 16, 2001 at 06:27 UTC ( [id://88994]=note: print w/replies, xml ) Need Help??


in reply to Can someone explain this one to me?

Well, sure, I can try.

The first part of the program, $_="6110>374086;2064208213:90<307;55"; simply puts a string with (seemingly) gibberish in $_. Then, the second statement, tr[0->][ LEOR!AUBGNSTY]; maps every character from 0 to > to the corresponding character in the second part of the transliteration statement ( LEOR!AUBGNSTY). Basically, the changes go like this:

Oldnew
'0'' '
'1''L'
'2''E'
'3''O'
'4''R'
'5''!'
'6''A'
'7''U'
'8''B'
'9''G'
':''N'
';''S'
'<''T'
'>''Y'

That range occurs because of the - in the first section of the tr statement. Anyway, after that it gets printed. (print).

The -l on the command line forces the output to add a newline at the end of every output statement, if I'm reading perlrun right.

Hope that helps. I'm sure if I'm wrong we'll both find out pretty soon. :)

His Royal Cheeziness

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-03-28 17:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found