in reply to regex/extracting whole lines
i wasn't entirely certain as to what you were trying to accomplish, though, so this might not be very useful. ):#!/usr/bin/perl use warnings; use strict; my ($line,$i,$n,$emailtext); while( $line=<DATA> ) { if( $line =~ m/^\*\*$/) { $emailtext .= <DATA> if(*DATA); next if ( $line =~ m/^\*\*$/ ); } } print "$emailtext\n"; # you could start your print MAIL # stuff here. __DATA__ ** She turned me into a newt! ** One day, a shell shall emerge from the masses, written in Perl, and it will be Good. ** A newt?! ** The people will rejoice, and it shall be dubbed 'SuperShell'. ** I got better. **
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: regex/extracting whole lines
by kelleher (Initiate) on Oct 19, 2001 at 18:17 UTC | |
by strfry() (Monk) on Oct 19, 2001 at 18:31 UTC | |
by kelleher (Initiate) on Oct 19, 2001 at 18:50 UTC | |
by strfry() (Monk) on Oct 19, 2001 at 20:33 UTC |