Thanks for all the great ideas. What I decided to do
was just check for '[PSserver' because this part is
causing me issues and it isn't needed.
In my script I have writtern as such. I would like to
split the two apart, but can just do a next and ignore
it for now.
$name = 'HP4000 [PSserver01]';
if ( $name =~ /[PSserver/ ) {
next;
}
running this straight as a script with the '-d' switch
or without, it works fine, but if I compile it and run
it, for some reason it is ignored and I end up with my
issue. IS there a better way to trap for this?
/J..
--- Robert Johnson <[EMAIL PROTECTED]> wrote:
>
> Jim Hansen wrote:
> >
> > Sorry. Lousy explanation. I have a string that
> will have
> > PSserver01...02, etc. I need to check for this
> string:
> >
> > $Printserver = "HP4000 [PSserver01]"
> >
> > I guess this can be as simple as
> >
> > $Printserver = "HP4000 [PSserver01]"
> > if ( ! /PSserver/ ) {
> > do
> > }
>
>
> Not quite sure what you want to do, but here's an
> example that could
> cover several possible scenarios:
>
> my $name, $type, $number;
> if ($Printserver =~ /(\S+)\s+\[(\w+)(\d+)\]/) {
> $name=$1;
> $type=$2;
> $number=$3;
> }
> else {
> die "\$Printserver variable match error, stopped";
> }
> if ($name eq "HP4000") { #found exact string
> HP4000 in name field
> ...
> }
> if ($type !~ /PServer/) { #did not match PServer
> within type field
> ...
> }
> elsif ($number=2) { #found PServer02 (since match
> above
> failed)
> ...
> }
>
>
> hope this helps.
> robert
>
>
__________________________________
Do you Yahoo!?
Plan great trips with Yahoo! Travel: Now over 17,000 guides!
http://travel.yahoo.com/p-travelguide
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs