Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use feature ':5.10';
- sub arrprint
- {
- my $length = @_;
- print "[";
- for ($i = 0; $i < $length; $i++) {
- #Print the value at the place
- print @_[$i];
- #For all BUT the last, add a comma
- if ($i < $length - 1) {
- print ";";
- }
- }
- print "]\n";
- }
- my @arr = split(/,/, <>);
- chop @arr[-1];
- arrprint @arr;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement