!/usr/bin/perl use Data::Dumper; my @arr = qw(book dog cat); print Reformat( Dumper ( \@arr ) ); sub Reformat { my @dmp = split( /\n/, shift ); # split lines and remove cr shift @dmp; # get rid of $varx=[ line $_ = join ( '', @dmp ); # put rest together s/\s+//g; # kill whitespace return "[$_\n"; # put back [ and add a cr }
-M
Free your mind
In reply to Re: Printing Array with quote and comma
by Moron
in thread Printing Array with quote and comma
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |