in reply to Re^4: Adding a TAB after a certain ammount of characters
in thread Adding a TAB after a certain ammount of characters
Now the file looks like this perl1.pl script looks like this (after some modifications I did from reading the replies
#!/usr/local/bin/perl perl -Mstrict -Mwarnings -E my $text = q{2013020400000000006810083610022013068100200220130688000200494}; my @offs = ( 17, 6, 31, 3, 3 ); my @cums = ( 0 ); push @cums, $_ + $cums[ -1 ] for @offs; substr $text, $_, 0, q{-} for reverse @cums[ 1 .. $#cums ]; say $text;
And the reply I get from running the script is:
biancoari@biancoari ~/Desktop $ perl perl1.pl
syntax error at perl1.pl line 2, near "E
my "
Execution of perl1.pl aborted due to compilation errors.
I will add the
and modify the text, any idea if I am heading the right direction?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Adding a TAB after a certain ammount of characters
by hdb (Monsignor) on Apr 17, 2013 at 12:11 UTC | |
Re^6: Adding a TAB after a certain ammount of characters
by choroba (Cardinal) on Apr 17, 2013 at 12:33 UTC | |
by biancoari (Initiate) on Apr 17, 2013 at 16:04 UTC | |
by choroba (Cardinal) on Apr 17, 2013 at 16:32 UTC | |
by biancoari (Initiate) on Apr 17, 2013 at 17:33 UTC |
In Section
Seekers of Perl Wisdom