Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

perl-beginner · Perl Beginners Mailing List

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 3765
  • Category: Perl
  • Founded: Aug 2, 1998
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 25910 - 25940 of 27459   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#25910 From: "Santosh Sugur" <santosh.sugur@...>
Date: Tue Dec 4, 2007 4:40 pm
Subject: child process (apparently) not returning error
santosh_sugur
Send Email Send Email
 
Hi Guys,

I have recently started  working with multiple (child ) processes. I
have the following code which is not returning any error: Please see
below where in the subroutine spawn_proc() I wait on STDIN and delete
a file that is about to be opened and expect an error. However i don't
get any error and it just continues with the other files. Please let
me know what am i doing wrongly? The intent is to be sure that all
files are opened and truncated successfully and print a message even
if a single file doesn't otherwiose print success.

#!/usr/bin/perl

use strict;
use warnings;
use Fcntl;
use POSIX ":sys_wait_h";


print "Opening (opendir) dir $data_loc \n";
my $rc = opendir DIRHANDLE, "$data_loc";
if (!$rc)
{
    print "$! \n";
    exit;
}

my @allfiles = readdir DIRHANDLE;

spawn_proc(@allfiles);

closedir DIRHANDLE;
my $kid;
do {
     $kid = waitpid(-1,&WNOHANG);
} until $kid == -1;

print "All went fine \n";



sub spawn_proc
{
    my @allfiles = @_;
    foreach my $file (@allfiles)
    {
       my $pid;
       if($pid = fork)
       {
          print "current process pid: $pid\n";
       }
       elsif(defined $pid)
       {
          # Child process is here
          if (-f "$data_loc/$file")
          {
             $| = 1;
             print "Opening $data_loc/$file\n";

             <STDIN>; #### So that  can delete one of the files it is
about to open and expect an error.

             sysopen(FILE, "$data_loc/$file", O_RDWR) or die "Can't
open $data_loc/$file: $!\nFAIL \n", exit (1);
             print "truncating $data_loc/$file\n";
             my $truncate_res = truncate "$data_loc/$file", 1024;
             if (!$truncate_res)
             {
                die "Couldn't truncate file $file,: $! \nFAIL \n", exit (1);
             }

             close FILE;

          }
          exit (0);
       }


    }


}



Thanks in advance,
Santosh

#25911 From: "Santosh Sugur" <santosh.sugur@...>
Date: Wed Dec 5, 2007 1:22 pm
Subject: Re: child process (apparently) not returning error
santosh_sugur
Send Email Send Email
 
I could get this working by removing the 'or' in

           sysopen(FILE, "$data_loc/$file", O_RDWR) or die "Can't
open $data_loc/$file: $!\nFAIL \n", exit (1);
and replacing it explicitly with an if (! )

             if (!sysopen(FILE, "$data_loc/$file", O_RDWR))
             {
                print "Can't open $data_loc/$file: $!\n";
                $handle->shlock( );
                $fail = 1;
                $handle->shunlock( );
                exit (1);
             }

Also to track failures in multiple processes I used the IPC::Shareable
module from CPAN as explained in the Perl Cookbook (16.12.Sharing Variables
in Different Processes).

Regards,
Santosh

On Dec 4, 2007 10:10 PM, Santosh Sugur <santosh.sugur@...> wrote:

> Hi Guys,
>
> I have recently started  working with multiple (child ) processes. I
> have the following code which is not returning any error: Please see
> below where in the subroutine spawn_proc() I wait on STDIN and delete
> a file that is about to be opened and expect an error. However i don't
> get any error and it just continues with the other files. Please let
> me know what am i doing wrongly? The intent is to be sure that all
> files are opened and truncated successfully and print a message even
> if a single file doesn't otherwiose print success.
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
> use Fcntl;
> use POSIX ":sys_wait_h";
>
>
> print "Opening (opendir) dir $data_loc \n";
> my $rc = opendir DIRHANDLE, "$data_loc";
> if (!$rc)
> {
>   print "$! \n";
>   exit;
> }
>
> my @allfiles = readdir DIRHANDLE;
>
> spawn_proc(@allfiles);
>
> closedir DIRHANDLE;
> my $kid;
> do {
>    $kid = waitpid(-1,&WNOHANG);
> } until $kid == -1;
>
> print "All went fine \n";
>
>
>
> sub spawn_proc
> {
>   my @allfiles = @_;
>   foreach my $file (@allfiles)
>   {
>      my $pid;
>      if($pid = fork)
>      {
>         print "current process pid: $pid\n";
>      }
>      elsif(defined $pid)
>      {
>         # Child process is here
>         if (-f "$data_loc/$file")
>         {
>            $| = 1;
>            print "Opening $data_loc/$file\n";
>
>            <STDIN>; #### So that  can delete one of the files it is
> about to open and expect an error.
>
>            sysopen(FILE, "$data_loc/$file", O_RDWR) or die "Can't
> open $data_loc/$file: $!\nFAIL \n", exit (1);
>            print "truncating $data_loc/$file\n";
>            my $truncate_res = truncate "$data_loc/$file", 1024;
>            if (!$truncate_res)
>            {
>               die "Couldn't truncate file $file,: $! \nFAIL \n", exit (1);
>            }
>
>            close FILE;
>
>         }
>         exit (0);
>      }
>
>
>   }
>
>
> }
>
>
>
> Thanks in advance,
> Santosh
>


[Non-text portions of this message have been removed]

#25912 From: "s4ds1s1" <s4ds1s1@...>
Date: Sat Dec 8, 2007 6:48 pm
Subject: Real Job At Home for Programmer
s4ds1s1
Send Email Send Email
 
Real job at home for IT (programmer, webmaster, webdesign,
webpromotion, translator, copywriting and etc). 1000 more project can
you follow but you must have skill to finish project, you can select
project appropriate you skill and you will be pay after you finish
project.

This is serious job so please read all guide and tips trick how wons
project because much worker confused how to get project after they
sign-up. in this site will be explain step by step how to get project.
http://freelancer-it.co.nr

#25913 From: "Amar Subramanian" <amarsub@...>
Date: Sun Dec 9, 2007 5:36 am
Subject: RE: [PBML] SFTP and SSH - Does it work in Windows?
amarsub
Send Email Send Email
 
I'm not sure if this is redundant but I can tell you that I've had lots of
luck using WinSCP.   It can use the secure FTP protocol and uses Putty as
the SSH.



Amar Subramanian



   _____

From: perl-beginner@yahoogroups.com [mailto:perl-beginner@yahoogroups.com]
On Behalf Of Fish, David
Sent: Monday, December 03, 2007 12:07 PM
To: perl-win32-users@...; perl-beginner@yahoogroups.com
Subject: [PBML] SFTP and SSH - Does it work in Windows?



Hello! I have been reviewing over several google searches and the use
of SSH and SFTP on Windows XP to a Unix box does not look to promising.
The Unix SSH/SFTP I am using is Cygwin. Has anyone got this to work in
a Windows to Unix? Am I going down a endless of errors trying to get
this to work?

David Fish
Senior Systems Analyst
Property System Services
Work (301) 380-3331
BlackBerry (301) 646-8985
david.fish@marriott <mailto:david.fish%40marriott.com> .com





[Non-text portions of this message have been removed]

#25914 From: "cside30" <kpatters@...>
Date: Wed Dec 12, 2007 10:02 pm
Subject: parse arg variables...
cside30
Send Email Send Email
 
Hello,

I am a newbie to perl.

I am getting data from an arg with multiple blocks of data.
for example, a variable named, $abendstatus, will have a value of
"Ended Not OK" as data.

How do I parse this data into 3 different variables to show as

$line1 = ended
$line2 = Not
$line3 = OK


Thanks...

#25915 From: merlyn@...
Date: Wed Dec 12, 2007 10:20 pm
Subject: Re: [PBML] parse arg variables...
merlynstoneh...
Send Email Send Email
 
>>>>> "cside30" == cside30  <kpatters@...> writes:

cside30> Hello,
cside30> I am a newbie to perl.

cside30> I am getting data from an arg with multiple blocks of data.
cside30> for example, a variable named, $abendstatus, will have a value of
cside30> "Ended Not OK" as data.

cside30> How do I parse this data into 3 different variables to show as

cside30> $line1 = ended
cside30> $line2 = Not
cside30> $line3 = OK

You don't want three different variables.  Hint: any variable that ends in a
sequence, like "1" "2" "3" or "a" "b" "c" means you should have put that
information into a data structure instead.

You might want:

     $data = "Ended Not OK";
     @words = split ' ', $data;

now $words[0] is "Ended", and so on.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

#25916 From: "cside30" <kpatters@...>
Date: Wed Dec 12, 2007 10:28 pm
Subject: Re: [PBML] parse arg variables...
cside30
Send Email Send Email
 
WOW...

Thanks...

Can you recommend a book or an online book where I can educate myself
more on that command?? I was looking online on Perl.org is that a good
website??



--- In perl-beginner@yahoogroups.com, merlyn@... wrote:
>
> >>>>> "cside30" == cside30  <kpatters@...> writes:
>
> cside30> Hello,
> cside30> I am a newbie to perl.
>
> cside30> I am getting data from an arg with multiple blocks of data.
> cside30> for example, a variable named, $abendstatus, will have a
value of
> cside30> "Ended Not OK" as data.
>
> cside30> How do I parse this data into 3 different variables to show as
>
> cside30> $line1 = ended
> cside30> $line2 = Not
> cside30> $line3 = OK
>
> You don't want three different variables.  Hint: any variable that
ends in a
> sequence, like "1" "2" "3" or "a" "b" "c" means you should have put that
> information into a data structure instead.
>
> You might want:
>
>     $data = "Ended Not OK";
>     @words = split ' ', $data;
>
> now $words[0] is "Ended", and so on.
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
777 0095
> <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!
>

#25917 From: merlyn@...
Date: Thu Dec 13, 2007 3:51 am
Subject: Re: [PBML] parse arg variables...
merlynstoneh...
Send Email Send Email
 
>>>>> "cside30" == cside30  <kpatters@...> writes:

cside30> Can you recommend a book or an online book where I can educate myself
cside30> more on that command?? I was looking online on Perl.org is that a good
cside30> website??

learn.perl.org.

But I love the leading line... so let me use it.

"Why yes, please check out 'Learning Perl', which does what it says
in the title!"

Of course, that's my book. :)

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

#25918 From: Klaas Gadeyne <klaas.gadeyne@...>
Date: Thu Dec 13, 2007 4:56 pm
Subject: Yet another regex question (fixed width look behind?)
klaas.gadeyne@...
Send Email Send Email
 
I'm looking for a perl regex that matches all strings except those
beginning with a particular substring.

Let's suppose the substring is "/debian", then following strings won't match:

/debian/dists/etch/Release
/debian/db/packages.db
/debian/

All other strings, fi

/index.html
/bodypages/index.php
/index.php?param=value
/index.php?param=debian

will match

As might be clear from the above example, the goal is to match certain
parts of url's that are fed into a webserver, which means I cannot use
perl statements (such as negations) to keep the regex itself rather
simple :-(
Fighting my way through manpages, I found some patterns that come
close (such as the fixed width look behind pattern (?<!pattern), but
nothing works as it should (or more correct, as I want it to :-), eg.

if ("/debian/index.php" =~ /^(\/(?<!debian\/).*)/ ) {
      print "It, $1, matches\n";
}
else {
      print "It doesn't match\n";
}

yields

It, /debian/index.php, matches

And using an non greedy variant (.*?) I get

It, , matches

Both of these expressions shouldn't match though :-(

Any ideas? Thx!

Klaas

The context:
An apache configuration where all url's that do not start with "/debian/..."
should be redirected to poort 443 (https)

So I need a single line in my apache configuration that looks like

RedirectMatch ^/[^(debian/.*)] https://myserver/$1

(I know the above regex is nonsense)

#25919 From: merlyn@...
Date: Thu Dec 13, 2007 6:37 pm
Subject: Re: [PBML] Yet another regex question (fixed width look behind?)
merlynstoneh...
Send Email Send Email
 
>>>>> "Klaas" == Klaas Gadeyne <klaas.gadeyne@...> writes:

Klaas> Let's suppose the substring is "/debian", then following strings won't
match:

Klaas> /debian/dists/etch/Release
Klaas> /debian/db/packages.db
Klaas> /debian/

Klaas> All other strings, fi

Klaas> /index.html
Klaas> /bodypages/index.php
Klaas> /index.php?param=value
Klaas> /index.php?param=debian

Klaas> will match

Klaas> As might be clear from the above example, the goal is to match certain
Klaas> parts of url's that are fed into a webserver, which means I cannot use
Klaas> perl statements (such as negations) to keep the regex itself rather
Klaas> simple :-(

Not sure what you mean by that.  Won't

   my $your_regex = qr{^/debian/};
   if (/$your_regex/) {
     # reject the line
   } else {
     # accept the line
   }

work?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

#25920 From: "Jeff Pinyan" <japhy.734@...>
Date: Thu Dec 13, 2007 6:39 pm
Subject: Re: [PBML] Yet another regex question (fixed width look behind?)
evilffej
Send Email Send Email
 
On Dec 13, 2007 11:56 AM, Klaas Gadeyne <klaas.gadeyne@...> wrote:
>
> I'm looking for a perl regex that matches all strings except those
> beginning with a particular substring.
>
> Let's suppose the substring is "/debian", then following strings won't match:
>
> /debian/dists/etch/Release
> /debian/db/packages.db
> /debian/
>
> All other strings, fi
>
> /index.html
> /bodypages/index.php
> /index.php?param=value
> /index.php?param=debian
>
> will match

Something like this will work:

   if ($string =~ m{^(?!/debian)}) {
     print "[$string] does not begin with '/debian'\n";
   }

> if ("/debian/index.php" =~ /^(\/(?<!debian\/).*)/ ) {
> print "It, $1, matches\n";
> }

The problem is that your regex says:  "match beginning-of-line, then a
/, then, look behind us to make sure we're not preceded by 'debian/',
..."  That condition will never be met, since the only character
matched so far is the / at the beginning of the string!  I think my
solution above will work fine for you.

> So I need a single line in my apache configuration that looks like
>
> RedirectMatch ^/[^(debian/.*)] https://myserver/$1

I don't know if Apache can handle (?!...), but if does, then my code
should still be acceptable.

   RedirectMatch ^(?!/debian/)(.*) https://myserver/$1


--
[Mary said,] "Do whatever he tells you." ~ John 2:5

#25921 From: "Ken" <ken.poyser@...>
Date: Thu Dec 13, 2007 7:16 pm
Subject: <STDIN> not working
olets3
Send Email Send Email
 
I am new to this language and I am following
an example in a book


$pmt=<STDIN>

and it doesn't seem to stop to allow me to input
an amount from the keyboard


Any suggestions

Thanks
Ken

#25922 From: Gilles Beauregard <gilles@...>
Date: Fri Dec 14, 2007 5:44 pm
Subject: Binmode
balour_2000
Send Email Send Email
 
Hello!

I have to copy some images on my Windows system with Perl.

I use the following script to do so:

$in_ = "original.gif" ;

open (IN,"$in_") ;
@fichier=<IN> ;
close (IN) ;

$out = "destination.gif" ;

open (OUT,">$out") ;
binmode OUT, ":raw" ;
print OUT @fichier ;
close (OUT) ;

Some images are copy whithout problem, but some others are
corrupt, some byte is missing.

I can't figure the reason of that behavior.

Any help are welcome.

Gilles B.







---
Webmasters helping webmasters
http://www.balour.org/

#25923 From: "jabir ahmed" <jabirahmed@...>
Date: Fri Dec 14, 2007 6:22 pm
Subject: Re: [PBML] Binmode
jabirahmed
Send Email Send Email
 
use File::Copy
   or
try to

binmode(FILE_HANDLE) This function puts FILE_HANDLE into a binary mode.

http://www.schogini.com/articles/File-Functions.html

On Dec 14, 2007 11:14 PM, Gilles Beauregard <gilles@...> wrote:

>   Hello!
>
> I have to copy some images on my Windows system with Perl.
>
> I use the following script to do so:
>
> $in_ = "original.gif" ;
>
> open (IN,"$in_") ;
> @fichier=<IN> ;
> close (IN) ;
>
> $out = "destination.gif" ;
>
> open (OUT,">$out") ;
> binmode OUT, ":raw" ;
> print OUT @fichier ;
> close (OUT) ;
>
> Some images are copy whithout problem, but some others are
> corrupt, some byte is missing.
>
> I can't figure the reason of that behavior.
>
> Any help are welcome.
>
> Gilles B.
>
> ---
> Webmasters helping webmasters
> http://www.balour.org/
>
>



--
If you haven't found something you are willing to die for, you are not
fit to live!
--
Phone: +91 9980799008
email: jabirahmed@... , jabirahmed@...
Instant Messenger:
yahoo  jabirahmed@...,msn : jabir07@...,ICQ: 56327312, Skype:
jabirahmed


[Non-text portions of this message have been removed]

#25924 From: klaas.gadeyne@...
Date: Thu Dec 13, 2007 7:08 pm
Subject: Re: [PBML] Yet another regex question (fixed width look behind?)
klaas007be
Send Email Send Email
 
> On Dec 13, 2007 11:56 AM, Klaas Gadeyne <klaas.gadeyne@...> wrote:
[...]
> I don't know if Apache can handle (?!...), but if does, then my code
> should still be acceptable.
>
>   RedirectMatch ^(?!/debian/)(.*) https://myserver/$1

Well, AFAIK mod_alias (which provides RedirectMatch) doesn't, but
mod_rewrite does.

I'm not sure if this is the best possible option, but

         RewriteEngine On
         RewriteRule !^/debian.*$ https://www.myserver.org%{REQUEST_URI} [R]

seems to do the trick

Thx for the support!

Klaas

#25925 From: Bora Uyar <borauyar@...>
Date: Wed Dec 12, 2007 10:32 pm
Subject: Re: [PBML] parse arg variables...
borauyar2003
Send Email Send Email
 
if you want, you can download from
http:\\students.sabanciuniv.edu\~borauyar\perl\perlbooks.zip

cside30 wrote:
>
> WOW...
>
> Thanks...
>
> Can you recommend a book or an online book where I can educate myself
> more on that command?? I was looking online on Perl.org is that a good
> website??
>
> --- In perl-beginner@yahoogroups.com
> <mailto:perl-beginner%40yahoogroups.com>, merlyn@... wrote:
> >
> > >>>>> "cside30" == cside30 <kpatters@...> writes:
> >
> > cside30> Hello,
> > cside30> I am a newbie to perl.
> >
> > cside30> I am getting data from an arg with multiple blocks of data.
> > cside30> for example, a variable named, $abendstatus, will have a
> value of
> > cside30> "Ended Not OK" as data.
> >
> > cside30> How do I parse this data into 3 different variables to show as
> >
> > cside30> $line1 = ended
> > cside30> $line2 = Not
> > cside30> $line3 = OK
> >
> > You don't want three different variables. Hint: any variable that
> ends in a
> > sequence, like "1" "2" "3" or "a" "b" "c" means you should have put that
> > information into a data structure instead.
> >
> > You might want:
> >
> > $data = "Ended Not OK";
> > @words = split ' ', $data;
> >
> > now $words[0] is "Ended", and so on.
> >
> > --
> > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
> 777 0095
> > <merlyn@...> <URL:http://www.stonehenge.com/merlyn/
> <http://www.stonehenge.com/merlyn/>>
> > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
> training!
> >
>
>


[Non-text portions of this message have been removed]

#25926 From: merlyn@...
Date: Mon Dec 17, 2007 4:34 pm
Subject: Re: [PBML] parse arg variables...
merlynstoneh...
Send Email Send Email
 
>>>>> "Bora" == Bora Uyar <borauyar@...> writes:

Bora> if you want, you can download from
Bora> http:\\students.sabanciuniv.edu\~borauyar [REDACTED]

First, that's not a real URL.  Your slashes are leaning the wrong way.

Second, I find your posting highly offensive.  Those are ILLEGAL
copies of MY books.

Don't be a pirate.  People worked hard to bring you those books,
and you spit in their face.

Please remove that archive.

I've also sent a note to O'Reilly legal.  Your university will likely be
contacted with a takedown notice.  I presume they have a policy for dealing
with piracy.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

#25927 From: "concepts_systems" <concepts_systems@...>
Date: Mon Dec 24, 2007 6:50 am
Subject: [Commercial] Training on Perl Automation by Industry Professionals
concepts_sys...
Send Email Send Email
 
Hello All,

With a growing demand for Perl automation ,we are pleased to announce
a new weekend batch of "Perl Automation" for students & Professionals.

Course Highlights:

- Linux orientation
- PERL introduction
- PERL for Automation
- Various operators
- Data types
- File handling
- Pattern Matching
- Functions in PERL
- Processes Handling and Socket programming
- Command line options and Standard system variables
- References in PERL
- Object Oriented Perl programming
- PERL debugger

Apart from these all followings are also covered :

- How to create logs and reports in PERL based automation
- Mailing the logs/reports through PERL script

Labs

Carefully designed labs and exercises which will help participants to
apply knowledge gained through lectures immediately in their assignments.

Starting Date : 12 January, 2008.
Duration      : 40 Hours
Timings       : Saturday and Sunday, 3 hours per day.

Venue       :
Concepts Systems, Pentagon, Pune-Satara Road, Pune
602-603, The Pentagon, Shahu College Road,
Next to Pune-Satara Road,
Near Panchami Hotel, Parvati. Pune - 411009.

Registration: We encourage you to register at the earliest since there
are limited seats.

About Us:

Concepts Systems Educational Services has always been in forefront for
providing software professionals and aspirants with best-of-the-breed
technologies which ensure that professionals/students remain on the
cutting edge of technology and continue to win their goals.

If you have any queries feel free to call us on +91-020-24216888 /
9960638738 Or  mail us at training@.... For customized
on-site training for your team, send a mail to info@....

Thanks & Regards,
Team
Concepts Systems Educational Services.

#25928 From: adsis kami <s4ds1s1@...>
Date: Tue Dec 25, 2007 8:39 pm
Subject: Job Project IT
s4ds1s1
Send Email Send Email
 
Real job at home for IT (programmer, webmaster, webdesigner,
webpromotion,graphic design, translator, copywriter and etc). Much project can
you follow but you must have skill to finish project, you can select project
appropriate you skill and you will be pay after you finish project.

This is serious job so please read guide registration because much worker
confused how to get project. in this site will be explain step by step how to
get project.

Best Regards
John Smith MC
http://freelancer-it.co.nr







Send instant messages to your online friends http://uk.messenger.yahoo.com

[Non-text portions of this message have been removed]

#25929 From: "Dukelow, Don" <dukelow@...>
Date: Wed Jan 2, 2008 5:24 pm
Subject: Installing SSH
dondukelow
Send Email Send Email
 
I'm trying to install Perl SSH on a HP 32 bit system with OS B.11.11 U 9000/800.
When I do a "make test" after compiling I get following error.

# make test
         rm -f blib/arch/auto/Net/SSH2/SSH2.sl
         /usr/bin/ld  -b -L/usr/local/lib -L/opt/local/lib SSH2.o  -o
blib/arch/auto/Net/SSH2/SSH2.sl       \
            -L/usr/local/lib -lssh2      \

/usr/bin/ld: Invalid loader fixup in text space needed in output file for symbol
"libssh2_default_alloc" in input file "/usr/local/lib/libssh2.a(session.o)"
*** Error exit code 1

Stop.

I've compiled before on this system but does anyone know why this is happening?
-----
Don Dukelow

#25931 From: "Dukelow, Don" <dukelow@...>
Date: Tue Jan 8, 2008 3:59 pm
Subject: Referance of Arrawys of arrays
dondukelow
Send Email Send Email
 
I'm doing
my @lb10 = qw/lb10 lb20 lb30/;
my @lb21 = qw/lb21 lb31 lb11/;
my @lb32 = qw/lb32 lb12 lb22/;

my @arrList = qw/@vmcdlb10 @vmcdlb21 @vmcdlb32/;

&main (\@arrList)

Sub main {
    my ($arrList) = @_;

    my $arr_count = @{$arrList};
    for (my $x = '0'; $x < $arr_count; $x++) {
         print "$arrList->[$x]\n";
    }
}

All I'm getting is the name of the three arrays printed out ,  I need the
contents of the three arrays.  Can some one tell me why?  Also how do you get
the length of a array from the an array referance?  I know that "$arr_count =
@{$arrList};" isn't the best way to do this.
-----
Don Dukelow
HP License Team
Hewlett-Packard Company
Tel: 810-728-3388
e-mail: dukelow@...

#25932 From: "Peter L. Berghold" <peter@...>
Date: Tue Jan 8, 2008 4:08 pm
Subject: Re: [PBML] Referance of Arrawys of arrays
blue_cowdawg
Send Email Send Email
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dukelow, Don wrote:
>
> my @arrList = qw/@vmcdlb10 @vmcdlb21 @vmcdlb32/;
>

There's your trouble.  The "qw" operator is interpreting those variable
names as strings which is not what I understand you wanting to do.

Something like:

my @arrList = ( [@vmcdlb10],[@vmcdlb21], [@vmcdlb32] );

oughta do it...

- ----

Peter L. Berghold                   Unix Professional
Peter@...             AIM: redcowdawg YIM: blue_cowdawg
"Those who fail to learn from history are condemned to repeat it."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHg5/hUM9/01RIhaARAmcbAKDBggDFbooFQ3qqRTw7dPXvqL5DCACgphG8
crDQLNTwieYrAB3AF9iOrPk=
=IUFz
-----END PGP SIGNATURE-----

#25933 From: "Dukelow, Don" <dukelow@...>
Date: Tue Jan 8, 2008 4:21 pm
Subject: RE: [PBML] Referance of Arrawys of arrays
dondukelow
Send Email Send Email
 
Thank you that helped but I also had to add a index for the sub array like.

print "$arrList->[$x][1]\n";

I can live with this thanks again.

-----
Don Dukelow
HP License Team
Hewlett-Packard Company
Tel: 810-728-3388
e-mail: dukelow@...



________________________________
From: perl-beginner@yahoogroups.com [mailto:perl-beginner@yahoogroups.com] On
Behalf Of Peter L. Berghold
Sent: Tuesday, January 08, 2008 11:08 AM
To: perl-beginner@yahoogroups.com
Subject: Re: [PBML] Referance of Arrawys of arrays


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dukelow, Don wrote:
>
> my @arrList = qw/@vmcdlb10 @vmcdlb21 @vmcdlb32/;
>

There's your trouble. The "qw" operator is interpreting those variable
names as strings which is not what I understand you wanting to do.

Something like:

my @arrList = ( [@vmcdlb10],[@vmcdlb21], [@vmcdlb32] );

oughta do it...

- ----

Peter L. Berghold Unix Professional
Peter@...<mailto:Peter%40Berghold.Net> AIM: redcowdawg YIM:
blue_cowdawg
"Those who fail to learn from history are condemned to repeat it."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHg5/hUM9/01RIhaARAmcbAKDBggDFbooFQ3qqRTw7dPXvqL5DCACgphG8
crDQLNTwieYrAB3AF9iOrPk=
=IUFz
-----END PGP SIGNATURE-----




[Non-text portions of this message have been removed]

#25934 From: <Ward.P.Fontenot@...>
Date: Tue Jan 8, 2008 4:46 pm
Subject: Crypto
Ward.P.Fontenot@...
Send Email Send Email
 
Can anyone (hopefully) tell me why this doesn't work? All it *should* do
is output the contents of the CRL.

CODE:
------------------------------------------------------------------------
----------------------------------
#!/usr/bin/perl -w
use Convert::ASN1;
use Crypt::X509::CRL;
use Data::Dumper;

$crl = "/tmp/ent.crl";

$decoded= Crypt::X509::CRL->new(crl => $crl);

if ( $decoded->error ) {
	 warn "Error on parsing Certificate Revocation List: ",
$decoded->error;
}

print Dumper ($decoded);

Output:
------------------------------------------------------------------------
----------------------------------
Error on parsing Certificate Revocation List: decode error at
/usr/local/share/perl/5.8.8/Convert/ASN1/_decode.pm line 57.
Crypt::X509::CRL=HASH(0x8343c00)


Paul Fontenot
Cryptography Services - PKI
CAST|IST|EIM|TES|TIG|Wells Fargo
Email: ward.p.fontenot@... <mailto:giardcm@...>
Phone: (480) 437-7795

This message may contain confidential and/or privileged information. If
you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based on
this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.

#25935 From: "computerdribble" <computerdribble@...>
Date: Tue Jan 8, 2008 5:42 pm
Subject: Eval and memory problems
computerdribble
Send Email Send Email
 
Greetings all...

I used references found elsewhere to create a script to analyze log
files for specific things.

The "specific things" are stored in a mysql database as a regex expression
Example:

( ( $field =~ /blah/) and ($field =~ /that/) )

I need the regex expressions in a database to tweaking and allowing
others to maintain who do not know or who are as green as I am to Perl.

I open the MySql database, no problem, load the contents into arrays,
no problem.

Open the log file (approx 1.48megs in size) for reading only.

Ok, in the program ( I can;t post it as it stands)


I have a  logic loop

grab a line from the log file

run all regex expressions against the log line grabbed.  This could be
from 1 to 500 different tests.


its done in a EVAL statement.

similar to:

if ( eval $array[$vartoarraycontents] )
{
## if found.. do this

##  do this:  store information on line found and
## what found when compared to a rule/regex expression
## to be sent as an email to me

}

## send email.



that's about it.

It runs perfectly for small log files  (under 500k in size)
BUT on the larger log files...  EVAL blows out with a memory exhausted
error.  I am chaulking this up to the problem of memory leakage on the
EVAL function.


I am wondering IF there are any other ways to EVAL something prior to
doing a comparision?

I tried;

if ( eval { $array[$pointer] } )


and it throws back a hex code to me when I debug the EVAL contents.
(stored to a variable for debugging)

I am assuming that it throws me back a HASH of the test, but I can;t
figure out how to use that information.

I also tried  to store the eval { $array[ $pointer] }  to a variable
and it ONLY shows the contents of the array based upon the pointer!
<scratches head>



So my main question, is  is there an alternative to the EVAL


I'm using perl 5.8.1


thanks in advance!

Joe.

#25936 From: "computerdribble" <computerdribble@...>
Date: Tue Jan 8, 2008 6:36 pm
Subject: Re: Eval and memory problems
computerdribble
Send Email Send Email
 
I think what I want is to be able to macro expand
a variable that contains references to variables

example:

my $blah ="( ( $field =~ /blah/) and ($field =~ /that/) )"

if ($blah)
etc

how do I macro expand ?

thanks


--- In perl-beginner@yahoogroups.com, "computerdribble"
<computerdribble@...> wrote:
>
> Greetings all...
>
> I used references found elsewhere to create a script to analyze log
> files for specific things.
>
> The "specific things" are stored in a mysql database as a regex
expression
> Example:
>
> ( ( $field =~ /blah/) and ($field =~ /that/) )
>
> I need the regex expressions in a database to tweaking and allowing
> others to maintain who do not know or who are as green as I am to Perl.
>
> I open the MySql database, no problem, load the contents into arrays,
> no problem.
>
> Open the log file (approx 1.48megs in size) for reading only.
>
> Ok, in the program ( I can;t post it as it stands)
>
>
> I have a  logic loop
>
> grab a line from the log file
>
> run all regex expressions against the log line grabbed.  This could be
> from 1 to 500 different tests.
>
>
> its done in a EVAL statement.
>
> similar to:
>
> if ( eval $array[$vartoarraycontents] )
> {
> ## if found.. do this
>
> ##  do this:  store information on line found and
> ## what found when compared to a rule/regex expression
> ## to be sent as an email to me
>
> }
>
> ## send email.
>
>
>
> that's about it.
>
> It runs perfectly for small log files  (under 500k in size)
> BUT on the larger log files...  EVAL blows out with a memory exhausted
> error.  I am chaulking this up to the problem of memory leakage on the
> EVAL function.
>
>
> I am wondering IF there are any other ways to EVAL something prior to
> doing a comparision?
>
> I tried;
>
> if ( eval { $array[$pointer] } )
>
>
> and it throws back a hex code to me when I debug the EVAL contents.
> (stored to a variable for debugging)
>
> I am assuming that it throws me back a HASH of the test, but I can;t
> figure out how to use that information.
>
> I also tried  to store the eval { $array[ $pointer] }  to a variable
> and it ONLY shows the contents of the array based upon the pointer!
> <scratches head>
>
>
>
> So my main question, is  is there an alternative to the EVAL
>
>
> I'm using perl 5.8.1
>
>
> thanks in advance!
>
> Joe.
>

#25937 From: merlyn@...
Date: Tue Jan 8, 2008 6:43 pm
Subject: Re: [PBML] Re: Eval and memory problems
merlynstoneh...
Send Email Send Email
 
>>>>> "computerdribble" == computerdribble  <computerdribble@...> writes:

computerdribble> how do I macro expand ?

Is the answer in the FAQ not clear enough?

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

#25938 From: "computerdribble" <computerdribble@...>
Date: Tue Jan 8, 2008 7:05 pm
Subject: [PBML] Re: Eval and memory problems
computerdribble
Send Email Send Email
 
which FAQ ?

thanks by the way.



--- In perl-beginner@yahoogroups.com, merlyn@... wrote:
>
> >>>>> "computerdribble" == computerdribble  <computerdribble@...>
writes:
>
> computerdribble> how do I macro expand ?
>
> Is the answer in the FAQ not clear enough?
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
777 0095
> <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!
>

#25939 From: "Boyle, Christopher" <Christopher.Boyle@...>
Date: Tue Jan 8, 2008 7:14 pm
Subject: RE: [PBML] Re: Eval and memory problems
Christopher.Boyle@...
Send Email Send Email
 
http://faq.perl.org/





________________________________

From: perl-beginner@yahoogroups.com
[mailto:perl-beginner@yahoogroups.com] On Behalf Of computerdribble
Sent: Tuesday, January 08, 2008 2:05 PM
To: perl-beginner@yahoogroups.com
Subject: [PBML] Re: Eval and memory problems





which FAQ ?

thanks by the way.

--- In perl-beginner@yahoogroups.com
<mailto:perl-beginner%40yahoogroups.com> , merlyn@... wrote:
>
> >>>>> "computerdribble" == computerdribble <computerdribble@...>
writes:
>
> computerdribble> how do I macro expand ?
>
> Is the answer in the FAQ not clear enough?
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
777 0095
> <merlyn@...> <URL:http://www.stonehenge.com/merlyn/
<http://www.stonehenge.com/merlyn/> >
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!
>


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________



NOTICE OF CONFIDENTIALITY: Information included in and/or attached to this
electronic mail transmission may be confidential. This electronic mail
transmission is intended for the addressee(s) only. Any unauthorized disclosure,
reproduction, or distribution of, and/or any unauthorized action taken in
reliance on the information in this electronic mail is prohibited. If you
believe that you have received this electronic mail transmission in error,
please notify the sender by reply transmission, or contact
helpdesk@..., and delete the message without copying or disclosing it.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

[Non-text portions of this message have been removed]

#25940 From: "computerdribble" <computerdribble@...>
Date: Tue Jan 8, 2008 7:20 pm
Subject: [PBML] Re: Eval and memory problems
computerdribble
Send Email Send Email
 
Nope , not in there.  there is nothing in the FAQ concerning Macro
expansion.

Only Macros for Vi   (ick)

Went through that AGAIN and no luck.

anywhere else?

I really appreciate the pointers.  I guess thats what the
"perl-beginner" is all about.

tia!




--- In perl-beginner@yahoogroups.com, "Boyle, Christopher"
<Christopher.Boyle@...> wrote:
>
> http://faq.perl.org/
>
>
>
>
>
> ________________________________
>
> From: perl-beginner@yahoogroups.com
> [mailto:perl-beginner@yahoogroups.com] On Behalf Of computerdribble
> Sent: Tuesday, January 08, 2008 2:05 PM
> To: perl-beginner@yahoogroups.com
> Subject: [PBML] Re: Eval and memory problems
>
>
>
>
>
> which FAQ ?
>
> thanks by the way.
>
> --- In perl-beginner@yahoogroups.com
> <mailto:perl-beginner%40yahoogroups.com> , merlyn@ wrote:
> >
> > >>>>> "computerdribble" == computerdribble <computerdribble@>
> writes:
> >
> > computerdribble> how do I macro expand ?
> >
> > Is the answer in the FAQ not clear enough?
> >
> > --
> > Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503
> 777 0095
> > <merlyn@> <URL:http://www.stonehenge.com/merlyn/
> <http://www.stonehenge.com/merlyn/> >
> > Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> > See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
> training!
> >
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
>
>
> NOTICE OF CONFIDENTIALITY: Information included in and/or attached
to this electronic mail transmission may be confidential. This
electronic mail transmission is intended for the addressee(s) only.
Any unauthorized disclosure, reproduction, or distribution of, and/or
any unauthorized action taken in reliance on the information in this
electronic mail is prohibited. If you believe that you have received
this electronic mail transmission in error, please notify the sender
by reply transmission, or contact helpdesk@..., and delete the message
without copying or disclosing it.
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
> [Non-text portions of this message have been removed]
>

Messages 25910 - 25940 of 27459   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help