Etienne Vermaas wrote:
> 
> Hi all,

Hello,

> A check to see if a pathname is "relative" or complete in some of the shell
> scripts works (seems to work)
> but I am not clear about the ?! part in the expresion, and also it seems
> that they do go together, because leaving either the ? or the ! out screw up
> the results.
> I'll appreciat your help in getting to understand this

The perlre.pod document describes (?!...), (?=...) and other regular
expression Extended Patterns.

perldoc perlre


> $ perl -n -e '
> chomp;
> if (m/^(?!\/)/) {
>   print;
>   print " is a relative dir ..\n"
> } else {
>   print;
>   print " is a full dir\n"
> } ' < in.txt

This could also be written as:

perl -nle'
if ( m|^/| ) {
    print "$_ is a full dir"
} else {
    print "$_ is a relative dir .."
}' < in.txt



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to