in reply to Printing Array with quote and comma
!/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
|
|---|