On Sunday 01 February 2004 00:58, Marty Landman wrote:
> At 08:38 PM 1/31/2004, Daniela wrote:
> >I was wondering how I can do the following with sed (or another program):
>
> How's Perl, Daniela?
>
> >1. Output only the text from the start of the line to the first pipe
> > character
>
> $out = ($line =~ /^([^\|]+)/);
>
> >2. Output only the text between the last and the previous pipe character
>
> $out = ($line =~ /\|([^\|]+)|/);
>
> >Or, split the line at the pipe characters and assign the parts to
> >different shell variables.
>
> my @ary = split '|', $line;

Looks fine, but does Perl support multi-dimensional arrays?


> These are untested but probably pretty close at least. Sorry, I haven't
> gotten to shell scripting yet so I think in terms of Perl.
>
> Marty Landman   Face 2 Interface Inc 845-679-9387
> This Month's New Quiz --- Past Superbowl Winners
> Make a Website: http://face2interface.com/Home/Demo.shtml

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to