Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Adding <pre> at beginning </pre> at file end

by mickeyn (Priest)
on Apr 07, 2009 at 14:17 UTC ( #756033=note: print w/ replies, xml ) Need Help??


in reply to Adding <pre> at beginning </pre> at file end

Hi,

Not using a RE like you asked, but you can try something like:

use strict; use Tie::File; my $file = shift; tie my @array, 'Tie::File', $file or die "can't open $file...\n"; unshift @array => '<pre>'; push @array => '</pre>'; untie @array;
HTH,
Mickey


Comment on Re: Adding <pre> at beginning </pre> at file end
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://756033]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-11-26 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (162 votes), past polls