in reply to Re: Prepending characters to lines in file
in thread Prepending characters to lines in file

Well, you could use a regular expression if you had something against $data = "> $data"; =)

But the regex do gots the cool factor.

perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'

Replies are listed 'Best First'.
Re: Re: Re: Prepending characters to lines in file
by blakem (Monsignor) on Aug 03, 2001 at 04:17 UTC
    Um, those aren't the same.....
    my $data = <<"EOF"; I really like jellybeans of all colors and flavors pink lemonaide blue raspberry and orange marmalade are great EOF print "First try:\n"; print "> $data\n"; print "Second try:\n"; $data =~ s/^/> /mg; print "$data\n";
    Output
    First try: > I really like jellybeans of all colors and flavors pink lemonaide blue raspberry and orange marmalade are great Second try: > I really like > jellybeans > of all colors > and flavors > pink lemonaide > blue raspberry > and orange marmalade > are great

    -Blake