How?
I don't know perl all that well, I am just trying to convert some scripts.


----- Original Message -----
From: "kevin1" <[EMAIL PROTECTED]>
To: "Clayton Dukes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, February 26, 2001 10:29 AM
Subject: Re: [PHP] PERL to PHP


> your can use the PCRE functions in php - much better than ereg and all
> that - if you know perl already...
>
> Clayton Dukes wrote:
>
> >
> >
> > Hi :-)
> >
> > Can someone tell me how to do the equivalant of this Perl script in PHP?
> >
> >
> >
> > ###
> > ### This function prints all lines between the dashes read in a text
file
> > ###
> >
> > ### The file looks like this:
> >
> >
> >
> > # -----------------------------
> >
> > # Somedata:       something
> >
> > # Someother:      something else
> >
> > # ------------------------------
> >
> > #
> >
> > # Several paragraphs
> >
> > # Several paragraphs
> >
> > # Several paragraphs
> >
> > # ----------END--------------
> >
> > #
> >
> >
> >
> >
> >
> >
> >
> > #!/usr/bin/perl -w
> > @rray = <STDIN>;
> >
> >
> >
> >
> > $inside = 0;
> > foreach $line (@rray) {
> >   if ($line =~ /-----/ig) {
> >     $inside = 1;
> >   } elsif ($line =~ /-----/gi) {
> >     $inside = 0;
> >   }
> >
> >
> >
> >   if ($inside == 1) {
> >   print $line;
> > }
> > }
> >
> >
> >
> >
> >
> > TIA!
> >
> > Clayton Dukes
> > CCNA, CCDA, CCDP, CCNP
> > Internetwork Solutions Engineer
> > Internetwork Management Engineer
> > Thrupoint, Inc.
> > Tampa, FL
> > (c) 904.477.7825
> > (h) 904.292.1881
> >
> > attachment.txt
> >
> > Content-Type:
> >
> > text/plain
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to