Can't I use the hash in list context with something like
itsNotRegex(%sufixTable) ?
I use this hash in a program that find related suffix to know if a file has a
source ('.o' => '.c').. and keeping the list of suffixes in another is variable
is a kind of rework.
Thanks for the help!
> De: Shawn H Corey <[email protected]>
> Assunto: Re: File::Basename problem
> Para: [email protected]
> Data: Sexta-feira, 4 de Março de 2011, 13:22
> On 11-03-04 11:14 AM, Téssio Fechine
> wrote:
> > my ( $file, $dir, $sufix ) =
> fileparse( $item, %sufixTable );
>
> I don't think fileparse takes a hash as the final
> arguments. It would be converted to an array and both
> the keys and the values used.
>
> Also, from `perldoc File::basename`:
>
> If @suffixes are given each element is a pattern (either a
> string or a "qr//") matched against the end of the
> $filename. The matching portion is removed and becomes
> the $suffix.
>
> That mean all the periods in the hash will match any
> character.
>
> Try:
>
> my @sufixTable = ( '\\.div', '\\.tex', '\\.o', '\\.c',
> '\\.a', );
>
>
> -- Just my 0.00000002 million dollars worth,
> Shawn
>
> Confusion is the first step of understanding.
>
> Programming is as much about organization and
> communication
> as it is about coding.
>
> The secret to great software: Fail early &
> often.
>
> Eliminate software piracy: use only FLOSS.
>
> -- To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> http://learn.perl.org/
>
>
>
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/