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

Re: index offset mean?

by muba (Priest)
on Jan 18, 2013 at 16:44 UTC ( #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 $


Comment on Re: index offset mean?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2015-07-04 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls