Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: index offset mean?

by muba (Priest)
on Jan 18, 2013 at 16:44 UTC ( [id://1014083]=note: print w/replies, xml ) Need Help??


in reply to index offset mean?

Perhaps this little sample script will demonstrate the definition.

$ perl -e ' my $string = "Lorem ipsum"; my @array = qw(The quick brown fox jumps over the lazy dog); for my $offset (0..length($string)) { printf "Offset $offset: %s\n", substr($string, $offset); } for my $offset (0..$#array) { printf "Offset $offset: %s\n", $array[$offset]; } ' Offset 0: Lorem ipsum Offset 1: orem ipsum Offset 2: rem ipsum Offset 3: em ipsum Offset 4: m ipsum Offset 5: ipsum Offset 6: ipsum Offset 7: psum Offset 8: sum Offset 9: um Offset 10: m Offset 11: Offset 0: The Offset 1: quick Offset 2: brown Offset 3: fox Offset 4: jumps Offset 5: over Offset 6: the Offset 7: lazy Offset 8: dog $

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-04-20 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found