DBI.c: loadable library and perl binaries are mismatched

2016-05-17 Thread Ron Wingfield
I am getting no response from this post on the FreeBSD Forums: https://forums.freebsd.org/threads/56291/ If I try to execute a simple perl script that utilizes the DBI, the following error diagnostic: |# perl -T create_roster_db.pl DBI.c: loadable library and perl binaries are mismatched (got

Re: Debugging and passing constant value at run time

2015-07-07 Thread Ron Bergin
Which means that neither approach is perfect. I still prefer the variable over the constant. I have never done any benchmark tests to see if there is any significant performance difference. Have you? Ron - Original Message - From: "Shawn H Corey" To: beginners@perl.or

Re: Debugging and passing constant value at run time

2015-07-07 Thread Ron Bergin
> \$VERBOSE ); if( $DEBUG ){ say 'hello'; say 'goodbye' if $VERBOSE > 1; } Ron From: "Sharanbasappa Raghapur, ERS, HCLTech" To: "Perl Beginners" Sent: Tuesday, July 7, 2015 4:40:35 AM Subject: Debugging and passing constant value at run t

Re: Make scalar tainted

2014-12-06 Thread Ron Bergin
ou say about this: > $foo.=substr($ENV{PATH},0,0); #$foo tainted if $ENV{PATH} is tainted > Thank, and sorry for my runglish :) > > > I have not used it myself, but the Taint::Util module looks like it does just what you want. http://search.cpan.org/~avar/Taint-Util-0.08/Util.pm --

Re: Need more helpful error messages from Perl

2014-11-19 Thread Ron Bergin
Kevin Walzer wrote: > Running this code in Perl: > > use LWP::Simple; > my $url= "http://mywebsite.com/foo.ini";; > my $page = get($url); > > produced this error: > > sh: -c: line 0: unexpected EOF while looking for matching `'' > sh: -c: line 1: syntax error: unexpected end of file Those erro

Re: using string as module

2014-11-08 Thread Ron Bergin
Uri Guttman wrote: > On 11/08/2014 10:40 AM, Ron Bergin wrote: >> you could accomplish it with the use of eval. >> >> my $foo = eval "MyFoo::${pgm}Bar->new"; > > ewww. never use string eval for something as simple as that. > > my $foo = "MyFoo::$

Re: using string as module

2014-11-08 Thread Ron Bergin
$foo = MyFoo::{$pgm}Bar->new; > … > } > > This gives me an error. > What is the correct syntax? I don't see any valid reason why you'd want to do that, but if that's what you want, you could accomplish it with the use of eval. my $foo = eval "MyFoo::

Re: Apologetic request for simple one-off script

2014-07-17 Thread Ron Bergin
#x27;t use a slice at all: > > perl -nE'say((split/\s+/)[-1])' file > > > -- > Don't stop where the ink does. > Shawn You say you wouldn't use a slice but then go ahead and use a slice? According to the perldata documentation, that is a list slic

RE: script to match a valid email id

2014-07-10 Thread Ron Bergin
Sunita Pradhan wrote: > I do not want to use Cpan modules . > > -Sunita > What do you have against using a cpan module? If you don't want to use the module, then why not simply copy/use the regex that it uses to do the validation? $RFC822PAT = <<'EOF'; [\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:

Re: script to match a valid email id

2014-07-10 Thread Ron Bergin
Sunita Pradhan wrote: > I want to write a script which will verify a valid email address . > Could anybody give some ideas , how to write a pattern for this ? > > -Sunita > Take a look at the Email::Valid module. http://search.cpan.org/~rjbs/Email-Valid-1.194/lib/Email/Valid.pm -- To unsubscrib

Re: Creating a hash of arrays from

2014-07-10 Thread Ron Bergin
Ron Bergin wrote: > Others have already pointed what you were doing wrong, so I'll point out > something else. > > Instead of using 2 separate split statements, I'd use a single split > statement to assign $state and a @zipcodes array. > > use 5.010; > use

Re: Creating a hash of arrays from

2014-07-10 Thread Ron Bergin
'996', '997', '998', '999' ] ]; The Zip Codes of CA are $VAR1 = [ [ '95122', '95035', '95112' ] ]; -- Ron Bergin -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Need to Grep only fail count from the Pattern.

2014-06-24 Thread Ron Bergin
Uday Vernekar wrote: > Dear All, > > Slight Correction Made in Above Code. > I am grepping this Pattern depending on run count which will Always same > Pass count and Fail count will Vary. > | 72| Traffic Test |1| 561| > > [Code] > #!/usr/bin/perl > > use 5.10.0; > use strict; >

Re: Need to Grep only fail count from the Pattern.

2014-06-23 Thread Ron Bergin
Uday Vernekar wrote: > Hi All, > > > I have following Pattern from which I need to grep only the Fail count and > store that in a variable. > > U/A/S|Test|Test |Loop | Run |Pass |Fail| > Arguments > | Name |Count|Count|Count|Count | > ---

Re: check list if values meet criteria

2014-02-25 Thread Ron Bergin
t;0..999"); for my $value (@issues) { print "issue=[$value]\n"; unless (looks_like_number($value) and $range->inrange($value)) { warn "Issue '$value' is either not a number or is out out of range\n"; } } --- Ron -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread Ron Bergin
Martin G. McCormick wrote: > I have a perl script that I run as root which needs to > move a file from where it is to another directory. > > I keep getting the "Usage" help message and a > permission denied. If I su to root and manually make the move, > it works. > > The perl scr

Re: Is there a way to generate HTML reports?

2013-07-06 Thread Ron Weidner
Shaji, I've recently (6 months ago) created just such an application.  My approach was to create a simple template engine that supports 3 kinds of "tags".  The template engine will read a template file looking for these tags.  When a tag is found, the text for the tag is replaced by a some va

Who instantiated an object

2013-05-31 Thread Weidner, Ron
I have and object with a function called new. (seen below). What I want to do is instead of simply calling die I want to know who called "new" without the required params. (like a stacktrace) I've tried confess, longmess, and caller and they did not produce the caller of new. #!/usr/bin/perl

Re: module versions

2013-05-15 Thread Ron Bergin
ional to test if the desired version is loadable. http://search.cpan.org/~bingos/Module-Load-Conditional-0.54/lib/Module/Load/Conditional.pm -- Ron Bergin -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Can't close filehandle

2013-05-01 Thread Ron Bergin
#x27; at ./test02.pl line 20 > > > close does not fail if the command is ok, e.g. 'uname -a'. Can anybody > explain to me why close fails in the example above? > > > > -- > Thanks, > Manfred If you test the return code of the close call, you'll see that it

t character in regular expression

2012-10-25 Thread Weidner, Ron
In the following regex what is the "t" character doing? $linebuf =~ tr/\n/:/; -- Ron ** This e-mail is intended solely for the intended recipient or recipients. If this e-mail is addressed to you in er

POD and Perldoc

2012-09-13 Thread Weidner, Ron
I'm looking at documenting perl code I'm working on. I'm considering POD but I don't think it can do what I want. Example of what I would like... [code] # here I would put POD synopsis etc. # here I want to put POD that describes this function sub my_echo { my ($str)

Re: destroy widget

2012-09-05 Thread Ron Bergin
the Perforce client name:" >>        )->pack(-anchor=>'center'); >>        > > You're looking for the ->withdraw()method. # Hide main window $mw1->withdraw(); ... ... # Sometime later in the app show main window again $mw1->deiconify(); $mw1->raise(); Ron Bergin -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Win32::Watir on strawberry Perl

2012-09-04 Thread Ron Bergin
ge,$mode,$title) That line (1370) should be: my $_ret = Win32::MsgBox($message,$mode,$title) > -- Ron Bergin -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: how to set session variable (not session cookie) using perl CGI

2012-08-07 Thread Ron Bergin
generate page using tt >   > 2. another related issue is: How do I send a redirect URL to the browser > client, based on some conditions in the logic? >   > ty. > Rajeev > > -- http://search.cpan.org/~markstos/CGI-Session-4.48/lib/CGI/Session.pm --- Ron Bergin --

Re: one liner for removing string from an element of string array

2012-07-13 Thread Ron Bergin
e" ); my ($name,$path,$suffix) = fileparse($templates[1], '.template'); print Dumper ($name,$path,$suffix); outputs: $VAR1 = 'file2'; $VAR2 = '/a/b/c/d/e/f/'; $VAR3 = '.template'; -- Ron Bergin -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: how to do a reference to a func in Math::Trig

2012-06-23 Thread Ron Bergin
Charles Smith wrote: [snip] > > But this pgm fails: > > #!/usr/bin/env perl > use Math::Trig; > my $a = \&Math::Trig::cos; > &$a(0); > > Undefined subroutine &Math::Trig::cos called at modfunctor line 7. > The cos sub is defined in Math::Complex, which Math::Trig loads. Try this: use strict; us

Re: how to get a sequence of 01 02 ..

2012-06-11 Thread Ron Bergin
>lina wrote: > Hi, > > > $ for i in `seq -f '%02g' 1 10` ; do echo $i ; done > 01 > 02 > 03 > 04 > 05 > 06 > 07 > 08 > 09 > 10 > > I wonder how can I get something like above in the perl. > perl -e "for (1..10){printf(qq

Re: How can I extract the lines after A

2012-03-12 Thread Ron Bergin
lina wrote: > On Sun, Mar 11, 2012 at 11:15 PM, Ron Bergin wrote: >> lina wrote: >>> On Sun, Mar 11, 2012 at 10:45 PM, lina wrote: >>> >>> What I have come up so far : >>> >>> #!/usr/bin/env perl >>> >>> use strict;

Re: How can I extract the lines after A

2012-03-11 Thread Ron Bergin
lt;', $filename or die "Couldn't read $filename"; You should include the reason it failed in the die statement. open my $fh, '<', $filename or die "Couldn't read $filename <$!>"; > > > > while (my $line = <$fh>){ > if

Re: The Perl Programming Language

2012-01-22 Thread Ron Wingfield
I've also found the O'Reilly publications, _CGI programming with Perl_, and _Programming the Perl DBI_ very helpful. Shlomi Fish wrote: Hello Lívio, On Sun, 22 Jan 2012 13:47:26 + Lívio Cipriano wrote: Hi, I'm new to Perl but old in other programming languages. Is there a equivale

Deployment Issues (Was: don't know where to start??? comparing files)

2011-10-14 Thread Weidner, Ron
> Because this uses *my* environment when I run *your* Perl script. > That's broken. > Hardcode the path. Or install it using any of the module tools, which > will replace #!perl with the proper hardcoded local Perl path. I also view this as a deployment problem which has probably been solved m

List Experience

2011-10-01 Thread Ron Weidner
I've had mixed feelings about my experience on this list so far. I'm sharing these opinions because I feel it would be awesome if this list seemed friendlier to beginners. Several years ago I subscribed to this list and unsubscribed almost as quick as I could. The harshness of the responses

RE: Need help getting data from a structure..

2011-09-29 Thread Weidner, Ron
> Can someone explain how to access $InstDesc?? Also please > explain how I would access (that is read from or write to) > to the $Severity scalar on the bottom structure.. > Thanks in advance.. flk Sure I can help. (or guide you astray) #!/usr/bin/perl use strict; use warnings; my %PlcyActi

Code organization .pm

2011-09-04 Thread Ron Weidner
I have a class named Widget in a file named Widget.pm.  I have another class named Table in a file called Table.pm.  Table extends Widget. --- package Widget; #file Widget.pm #insert a bunch of methods...   --- package Table; #file Table.pm use Widget; @ISA=("Widget"); #insert several method

more oop array

2011-09-03 Thread Ron Weidner
In a module I have code that looks like this... sub add_widget {     my $self = shift;     my $new_widget = shift;     push ( @{$self->{WIDGETS}}, $new_widget ); } sub get_widgets {     my $self = shift;     return $self->{WIDGETS}; } I'm writing a test that is failing at runtime with the follow

oop array question

2011-09-03 Thread Ron Weidner
I'm trying to add a object to an array of objects.  The code below is wrong. sub add_widget {     my $self = shift;     my $new_widget = shift;     push ( @($self->{WIDGETS}), $new_widget ); } Later, I'm going to need to iterate over the array of widgets.  How can I accomplish these 2 tasks?

Find and Replace in Textfile

2011-08-21 Thread Ron Weidner
Recently, I was asked to find the first occurrence of a word in a text file and replace it with an alternate word.  This was my solution.  As a new Perl programmer, I feel like this solution was too C like and not enough Perl like.  So, my question is what would have been the Perl like solution

Useless use of private variable

2011-08-20 Thread Ron Weidner
{             push (@some_array, $i);         }     }     return @some_array; } my @some_array = get_some_array (8); my $comma = ""; for my $ele (@some_array) {     print $comma . $ele;     $comma = ", "; } print "\n"; -- Ron This is perl, v5.10.1 (*) built for i686-linux-gnu-thread-multi

Re: rmdir

2011-06-27 Thread Ron Bergin
es are getting deleted and not empty folders > > plz suggest > > > > > > From: Ron Bergin > To: Irfan Sayed > Cc: Shlomi Fish ; "pa...@laposte.net" > ; Perl Beginners > Sent: Monday, June 27, 2011 8:39 PM > Subject:

Re: rmdir

2011-06-27 Thread Ron Bergin
e the /s and /q and /f options. /FForce deleting of read-only files. /SDelete specified files from all subdirectories. /QQuiet mode, do not ask if ok to delete on global wildcard -- Ron Bergin -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org F

Re: how to trap print() errors?

2011-01-16 Thread Ron Bergin
Ron Bergin wrote: >>         print $s @_ or die $!; >> >> The downside is that the warning still gets printed: >> >>         print() on unopened filehandle NOSUCH at trap-print-errors2.pl >> line 12. >> >> And $! isn't very meaningful: >>

Re: how to trap print() errors?

2011-01-16 Thread Ron Bergin
On Jan 16, 3:52 pm, dpchr...@holgerdanske.com (David Christensen) wrote: > beginners: > > After RTFM, STFW, etc., I realized that print() was issuing a warning > and continuing. > > I came up with two solutions: > > 1.  perldoc -f print() states "Returns true if successful".  So: > >         print

Re: install a package on windows

2010-12-15 Thread Ron Bergin
vides the needed compiler so you can build/install modules using cpan. Ron -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: error opening file with open function

2010-11-07 Thread Ron Bergin
Cross thread posted at http://forums.devshed.com/perl-programming-6/error-opening-csv-file-with-open-function-761095.html J M wrote: > I was able to figure it out. Here is the update (probably not final) code > for anyone interested: > > > [code] > #! /usr/bin/perl > # > use DBI; > use DBD::mysql;

Re: "Perl Elements to Avoid" Document on http://perl-begin.org/

2010-10-11 Thread Ron Bergin
On Oct 10, 12:59 am, shlo...@iglu.org.il (Shlomi Fish) wrote: > On Sunday 10 October 2010 03:09:21 Ron Bergin wrote: > > > > > On Oct 7, 3:07 pm, shlo...@iglu.org.il (Shlomi Fish) wrote: > > > Hi all, > > > > after being tired of telling Perl newcomers about

Re: "Perl Elements to Avoid" Document on http://perl-begin.org/

2010-10-09 Thread Ron Bergin
On Oct 7, 3:07 pm, shlo...@iglu.org.il (Shlomi Fish) wrote: > Hi all, > > after being tired of telling Perl newcomers about the same problems with their > code times and times again, I've decided to create this page detailing "Perl > Elements to avoid": > > http://perl-begin.org/tutorials/bad-eleme

Opposite benchmark results between Linux and Windows

2010-08-10 Thread Ron Bergin
: C:\TEMP>timestamp.pl Rate Matt Ron Matt 162840/s -- -37% Ron 257003/s 58% -- [r...@099vicidial101 ~]# ./timestamp.pl Rate Ron Matt Ron 110132/s -- -29% Matt 155763/s 41% -- The code: #!/usr/bin/perl use strict; use warnings; use POSIX qw(strftime);

Re: Data migration

2010-07-27 Thread Ron Bergin
On Jul 26, 5:58 pm, ca...@cajuninc.com ("M.Lewis") wrote: > I'm migrating an old RedHat server to a new Debian server. In migrating > the data there's a problem in that on the RH server the UID starts at > 500, on the Debian server the UID starts at 1000. Resulting in something > like this: > > Old

Re: Nested if and elsif and else

2010-04-15 Thread Ron Bergin
On Apr 15, 9:21 am, rea...@newsguy.com (Harry Putnam) wrote: > r...@i.frys.com writes: > > Here's an example I gave in a similar question in another > > forum. > > Thanks... > > I'm sorry to ask more but if someone asked to be shown an > if/elsif/else construct being replaced by a dispatch table, I

Undefined Subroutine

2010-04-08 Thread Ron Wingfield
#!/usr/bin/perl -wT # #sub_test.pl . . .just a proof-of-concept # to get subroutines to be recognized. use strict; use warnings; use CGI; use CGI::Carp qw(fatalsToBrowser); my $q = new CGI; #- #my $con = $q->param('c

Re: Strawberry Perl capabilities?

2010-03-06 Thread Ron Bergin
On Mar 6, 10:38 am, r...@i.frys.com (Ron Bergin) wrote: > If using AS, then simply install MinGW which gives you the missing > compiler and proper cpan setup.  After that, AFAIK you'll have the > same functionality as Strawberry. > > http:

Re: Strawberry Perl capabilities?

2010-03-06 Thread Ron Bergin
On Mar 5, 4:39 pm, dpchr...@holgerdanske.com (David Christensen) wrote: > Shlomi Fish wrote: > > Actually, Strawberry Perl is preferable over AS Perl: > >http://strawberryperl.com/ Shlomi, If using AS, then simply install MinGW which gives you the missing compiler and proper cpan setup. After th

Re: Getting USER env variable in Windows -- How to?

2009-12-09 Thread Ron Bergin
On Dec 9, 7:01 am, tony1234567...@yahoo.co.uk (Tony Esposito) wrote: > I need to get the current USER env var in a Windows Perl program.  Does > anyone know how this is done?  I have done it on UNIX/Linux. > > Thx. perl -e "print $ENV{'USERNAME'}" -- To unsubscribe, e-mail: beginners-unsubscr..

Learning to 'fork()' the right way

2009-03-26 Thread Ron Smith
ript.pl is running.\n"; } else { print "testScript.pl is not running. I'll start it.\n"; my $pid = fork(); if (!defined($pid)) { die "Could not fork: $!\n"; } elsif ($pid == 0) { exec("/home/scripts/utils/develop/ron/testScript.pl&q

Re: I'm trying to install 'Net::SSH::Perl' on a Windows Box.

2009-03-16 Thread Ron Smith
--- On Mon, 3/16/09, Chas. Owens wrote: > From: Chas. Owens > Subject: Re: I'm trying to install 'Net::SSH::Perl' on a Windows Box. > To: geeksatla...@yahoo.com > Cc: "Perl" > Date: Monday, March 16, 2009, 6:51 AM > On Mon, Mar 16, 2009 at 03:51, Ron

Re: I'm trying to install 'Net::SSH::Perl' on a Windows Box.

2009-03-16 Thread Ron Smith
--- On Sun, 3/15/09, Chas. Owens wrote: > From: Chas. Owens > Subject: Re: I'm trying to install 'Net::SSH::Perl' on a Windows Box. > To: geeksatla...@yahoo.com > Cc: "Perl" > Date: Sunday, March 15, 2009, 5:46 AM > On Sun, Mar 15, 2009 at 04:56,

I'm trying to install 'Net::SSH::Perl' on a Windows Box.

2009-03-15 Thread Ron Smith
" at C:/strawberry/perl/site/lib/PPM.pm line 16 87." The package did not install so I googled this response but didn't come up with any clear-cut direction. ...any suggestions? I also ran accross the following while searching CPAN: Net::SSH::W32Perl MSWin32 compatibility

Re: I'm sure this is a common question, but I can't find the solution.

2009-03-14 Thread Ron Smith
> From: Beau E. Cox > Subject: Re: I'm sure this is a common question, but I can't find the > solution. > To: geeksatla...@yahoo.com > Date: Saturday, March 14, 2009, 10:51 PM > Ron, > > On Sat, Mar 14, 2009 at 7:28 PM, Ron Smith > wrote: > > >

Re: I'm sure this is a common question, but I can't find the solution.

2009-03-14 Thread Ron Smith
> Ron Smith wrote: > > Hello all, > > Hello, > > > How do you print elements of an array, each on its own > line, in a Windows' console? > > > > I'm doing the following: > > > > E:\My Documents>perl -e "use > ExtUtils::I

I'm sure this is a common question, but I can't find the solution.

2009-03-14 Thread Ron Smith
returns: Archive::TarArchive::ZipArray::CompareAutoLoaderCPANCPAN::ChecksumsCPAN::DistnameInfo ...etc. I need: Archive::Tar Archive::Zip Array::CompareAutoLoaderCPAN CPAN::Checksums CPAN::DistnameInfo ...etc. I tried "\n", '\n' and a 'foreach' loop, but nothing I

Re: connecting to multiple hosts using Net::SSH2

2009-03-10 Thread Ron Bergin
On Mar 9, 3:37 am, que...@gmail.com (Jerald Sheets) wrote: > On Mar 8, 2009, at 1:29 PM, Ron Bergin wrote: > > > > >> #!/usr/bin/perl -w > > > It's better to use the warnings pragma, instead of the -w switch > > Another note on this... I jus

Re: connecting to multiple hosts using Net::SSH2

2009-03-09 Thread Ron Bergin
On Mar 4, 4:46 am, que...@gmail.com (Jerald Sheets) wrote: > > I really think you're doing yourself a disservice by just throwing   > your program commands on lines, not indenting according to best   > practices.  It makes your code unreadable, and can make it very hard   > to debug the more involv

I'd like to monitor a running script.

2009-03-08 Thread Ron Smith
if ($process) { sleep 30} else { exec (./) or print STDERR "couldn't exec : $!"; } } Ron Smith geeksatla...@yahoo.com (213)300-9448 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: CPAN install module problem

2009-03-02 Thread Ron Bergin
On Feb 27, 9:03 pm, howac...@gmail.com (Howa) wrote: > Hi, > > Why sometimes I can use a command to install Perl module, e.g. > > perl -MCPAN -e "install Digest::MD5" > > But sometimes can't? > > e.g. > > perl -MCPAN -e "install Archive::Zip" > > >> Can't locate object method "install" via package

Re: Slow connexion with Net::SSH::Perl

2009-02-04 Thread Ron Bergin
On Feb 3, 12:38 pm, jul.col...@gmail.com (Julien Collas) wrote: > Hi everyone, > > I made a script using Net::SSH::Perl and I'm faced to some slow > connexion times. > I use rsa key to connect and it seems to be very slow, but not all the time. > Sometimes it's very quick ( 1sec ), sometimes not (f

Re: How do I print something out in color on windows cmd?

2009-02-03 Thread Ron Bergin
On Feb 1, 11:43 pm, psars...@ptc.com (Paryushan Sarsamkar) wrote: > I wanted to print some text on windows cmd in different colors, below is the > code that I am using which works fine on unix but not on windows L > > #!/usr/bin/perl > > use strict; > > use warnings; > > use Term::ANSIColor; > > p

Re: Neater way to declare variables

2009-01-08 Thread Ron Bergin
On Jan 8, 3:56 am, andrew.tayl...@hmrcaspire.com (Andrew Taylor) wrote: > Hello > > I have a script that is (at one point) reading through a file.  The file > is processed line by line and each line split into an array like so: > > while (<$TESTFILE>) > > { > >   my $cur_line=$_; > >   chomp ($cur_

Re: which module is suitable for logging into cisco devices

2008-11-25 Thread Ron Bergin
On Nov 23, 1:17 pm, [EMAIL PROTECTED] (Monnappa Appaiah) wrote: > i forgot to mention that, i'l be running the script from the windows machine > ..so pls let me know the module which can login to cisco devices > using ssh, execute certain commands and give me the output. > > Thanks, > Monna

Re: Trying to modify Perl script

2008-09-23 Thread Ron Bergin
On Sep 22, 10:16 am, [EMAIL PROTECTED] (Stephen Reese) wrote: > John, > > I made many of the changes but what is the addition of the 'next' statement > for? I tried to add the additional code but the script dies mentioning that > it is not terminated correctly. If I comment out the next statement t

Re: Understanding Perl script functionality

2008-09-21 Thread Ron Bergin
On Sep 19, 10:07 pm, [EMAIL PROTECTED] (Stephen Reese) wrote: > I am working on modifying a script that previously parsed Cisco ACL's > and changing it to parse IPS information. > > Here is an example of the two log formats. > > Sep 19 15:44:29 172.16.2.1 59800: 3725router: Sep 19 19:44:39: %SEC-6-

Re: hash of arrays

2008-08-19 Thread Ron Bergin
On Aug 18, 1:03 pm, [EMAIL PROTECTED] (Anjan Purkayastha) wrote: > hi, > i'm struggling with a hash of arrays problem. > suppose i create the following HOA: > $HOA{$key}= [qw(a,b,c,d)]; I doubt that the results of that assignment is what you want/expect. #!/usr/bin/perl #use strict; use warnings

Re: search and replace command with output

2008-08-19 Thread Ron Bergin
On Aug 13, 1:44 pm, [EMAIL PROTECTED] wrote: > Hi, > > I am trying to search & replace a string in a file using the below > perl command on unix. > > perl -pi -e 's/OLD/NEW/g' repltest.txt > > But I want the above command to display what lines were replaced. Is > it possible using some switch opti

Re: getting process id under NT

2008-08-03 Thread Ron Bergin
Process::Info ();'. Please do not do that. > eod > > When I set the environment variables I have Windows_NT has OS. > So it should work no ? > > Happytown a écrit : > > > On Jul 30, 11:09 am, [EMAIL PROTECTED] (Ron Bergin) wrote: > > > On Jul 29, 9:12 am,

Re: getting process id under NT

2008-07-29 Thread Ron Bergin
On Jul 29, 9:12 am, [EMAIL PROTECTED] (Epanda) wrote: > Hi HappyTown > > I have seen your web link but I don't think it can show me the PID if > I give the name of an existing and running Win NT application. > > On 28 juil, 05:24, [EMAIL PROTECTED] (Happytown) wrote: > > > On Jul 26, 3:14 am, [EMAI

Re: losing variable in CGI.pm redirect

2008-01-23 Thread Ron Bergin
On Jan 22, 1:31 pm, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > Hi, > Hopefully this appropriate question for this group. I am trying to > redirect to a website: > > print $query->redirect(-location=>test.cgi?ID=$value", - > method=>'GET'); > > Unfortunately the $value never gets passed and I e

Re: Manually installing perl modules on windows

2007-11-24 Thread Ron Bergin
On Nov 23, 7:26 am, [EMAIL PROTECTED] (Andy) wrote: > Hi, > > I am trying to talk to a programmable oven over serial port for heat > testing of a PCB. > > I am using ActiveState perl v5.8.8 on Windows XP. I am trying to > install the Win32:SerialPort package using Activestates Perl Package > Manage

Re: Formating the log

2007-11-22 Thread Ron Bergin
On Nov 22, 6:57 am, [EMAIL PROTECTED] (Avinashsuratkal) wrote: > > In short I need to read the text between 2 lines, which can be > incorporated in the perl script, but not a one-liner. > > Thanks, If my interpretation of your needs is correct, then this will do the job. #!/usr/bin/perl use stri

Re: Formating the log

2007-11-22 Thread Ron Bergin
On Nov 22, 6:57 am, [EMAIL PROTECTED] (Avinashsuratkal) wrote: > On Nov 22, 2:22 pm, [EMAIL PROTECTED] (Avinashsuratkal) > wrote: > > > > > On Nov 22, 2:27 am, [EMAIL PROTECTED] (Yitzle) wrote: > > > > On Nov 21, 2007 11:28 AM, avinashsuratkal <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > I ha

Re: Building a string to contain a "\"

2007-11-18 Thread Ron Bergin
On Nov 16, 1:12 pm, [EMAIL PROTECTED] (AndrewMcHorney) wrote: > Hello > > I am trying to build a string that contains the following text "dir > c:\ /S" so I can get a complete directory of all the files on drive C > and put them into an array with the following line of code - > @dir_list = 'dir c:\

Re: How can I assign system() call to a Variable

2007-11-14 Thread Ron Bergin
On Nov 13, 7:11 pm, [EMAIL PROTECTED] (Marco) wrote: > Hi... > > Can someone help me on this? Actually I can get the dara from the > system()...But it shows "0" when I print the $result...How can I > assign the system() to $result ?Thanks... > > here below is the code... > > $inact = "cat /proc

Re: How can I assign system() call to a Variable

2007-11-14 Thread Ron Bergin
On Nov 13, 7:11 pm, [EMAIL PROTECTED] (Marco) wrote: > Hi... > > Can someone help me on this? Actually I can get the dara from the > system()...But it shows "0" when I print the $result...How can I > assign the system() to $result ?Thanks... > > here below is the code... > > $inact = "cat /proc

Re: SSH with PERL

2007-11-02 Thread Ron Bergin
On Nov 2, 6:06 am, [EMAIL PROTECTED] (Lerameur) wrote: > On Nov 1, 9:29 pm, [EMAIL PROTECTED] (Tom Phoenix) wrote: > > > > > On 11/1/07, lerameur <[EMAIL PROTECTED]> wrote: > > > > I wrote a small script, the manual upload of a file works, but gives > > > me an error message:unable to initialize me

Re: Include variables from external perl script

2007-11-01 Thread Ron Bergin
On Oct 30, 6:50 pm, [EMAIL PROTECTED] (Howa) wrote: > On 10 30 , 9 38 , [EMAIL PROTECTED] (Ron Bergin) wrote: > > > On Oct 30, 3:34 am, [EMAIL PROTECTED] (Jeff Pang) wrote: > > > In addition to changing 'my' to our' in Config.pl, you'll also need to >

Re: Include variables from external perl script

2007-10-30 Thread Ron Bergin
On Oct 30, 7:50 am, [EMAIL PROTECTED] (Paul Lalli) wrote: > On Oct 30, 9:38 am, [EMAIL PROTECTED] (Ron Bergin) wrote: > > > > On 10/30/07, howa <[EMAIL PROTECTED]> wrote: > > > > > Consider the example below... > > > > > Config.pl > > &g

Re: Include variables from external perl script

2007-10-30 Thread Ron Bergin
On Oct 30, 3:34 am, [EMAIL PROTECTED] (Jeff Pang) wrote: > On 10/30/07, howa <[EMAIL PROTECTED]> wrote: > > > Consider the example below... > > > Config.pl > > == > > > #!/usr/bin/perl -w > > > my $value = "abc"; > > change 'my' to 'our'. > > > > > 1; > > > Script.pl > > == > > require "Con

Re: Hash Variables

2007-10-30 Thread Ron Bergin
On Oct 29, 8:25 pm, [EMAIL PROTECTED] (Kaushal Shriyan) wrote: > Hi > > I am referring to perldoc perlintro > my %fruit_color = ("apple", "red", "banana", "yellow"); > > You can use whitespace and the "=>" operator to lay them out more nicely: > >my %fruit_color = ( >

Re: array within array

2007-10-30 Thread Ron Bergin
On Oct 29, 11:09 am, [EMAIL PROTECTED] (John W . Krahn) wrote: > On Monday 29 October 2007 06:42, Mike Tran wrote: > > > Hey all, > > Hello, > > > I'm new with Perl and need help with this simple script. I'm still > > playing around with the script below to get a feel for Perl. My > > script below

Re: array within array

2007-10-29 Thread Ron Bergin
On Oct 29, 6:42 am, [EMAIL PROTECTED] (Mike Tran) wrote: > Hey all, > > I'm new with Perl and need help with this simple script. I'm still > playing around with the script below to get a feel for Perl. My script > below is incomplete and I'm doing an array within an array which is > incorrect. Plea

Re: Absolute noobie question regarding opening files on Windows platform

2007-10-26 Thread Ron Bergin
On Oct 25, 9:38 pm, [EMAIL PROTECTED] (mAyur) wrote: > On Oct 23, 6:55 pm, [EMAIL PROTECTED] (Paul Lalli) wrote: > > > > > On Oct 22, 3:27 pm, [EMAIL PROTECTED] (Ayesha) wrote: > > > > Hi all > > > > I wrote this code to read a file (in the same directory as the script) > > > on Win XP > > > **

Re: Array Manipulation

2007-10-25 Thread Ron Bergin
On Oct 25, 1:59 am, [EMAIL PROTECTED] (Irfan Sayed) wrote: > Hi All, > > I have one array say my @test=(1,2,3,4,5); > if I print this array it will print like this > print "@test\n"; > and the output is > 1 2 3 4 5 > > now my req. is that I want to store these array values in another array > in suc

Re: How do I replace a part of huge text file

2007-10-25 Thread Ron Bergin
On Oct 22, 1:52 am, [EMAIL PROTECTED] (Anand Shankar) wrote: > Hi, > > I would like to replace a part of a really big (4GB) text file. And > the contents that I want to change is really a small but continuous > portion. Could some one please help me with the best way I can do this > in perl? > > Th

Re: Absolute noobie question regarding opening files on Windows platform

2007-10-25 Thread Ron Bergin
On Oct 23, 6:57 am, [EMAIL PROTECTED] (Paul Lalli) wrote: > On Oct 23, 12:27 am, [EMAIL PROTECTED] (Ayesha) wrote: > > > I was not in the right directory, but I learnt about forward and > > backward slashed also. Thanks to all who replied > > Arg. This is exactly what I was afraid of. The post ab

Re: Absolute noobie question regarding opening files on Windows platform

2007-10-25 Thread Ron Bergin
On Oct 23, 6:57 am, [EMAIL PROTECTED] (Paul Lalli) wrote: > On Oct 23, 12:27 am, [EMAIL PROTECTED] (Ayesha) wrote: > > > I was not in the right directory, but I learnt about forward and > > backward slashed also. Thanks to all who replied > > Arg. This is exactly what I was afraid of. The post ab

Re: Can I modify the contents of a file, without creating a new one?

2007-10-12 Thread Ron Bergin
On Oct 11, 4:25 am, [EMAIL PROTECTED] (Jeff Pang) wrote: > 2007/10/11, PeiYu Zeng <[EMAIL PROTECTED]>: > > > Hello, > > > Can I modify the contents of a file, without creating a new one? > > Yes.You can use perl one-liner to do that, > > perl -pi.bak -e 'modify the current line if it match some con

Re: Can I modify the contents of a file, without creating a new one?

2007-10-12 Thread Ron Bergin
On Oct 11, 2:37 am, [EMAIL PROTECTED] (PeiYu Zeng) wrote: > Hello, > > Can I modify the contents of a file, without creating a new one? > > Now, the method that I modify the contents of a file is: > open( READHANDLE , "sourceFile" ); > open( WRITEHANDLE, ">destiFile" ); > > foreach my $

Re: undef in data dumper output

2007-09-26 Thread Ron Bergin
On Sep 24, 8:38 pm, [EMAIL PROTECTED] wrote: > I'm using html::tokeparser::simple and will next place desired data > into hashes, but I'm having problems getting to the individual pieces > of data. > > After using html::tokeparser::simple, then using a regex and pushing > data into a new array, I c

Re: want to make a list of all users connected to a network

2007-09-09 Thread Ron Bergin
On Sep 9, 11:56 am, [EMAIL PROTECTED] wrote: > On Sep 9, 8:46 am, [EMAIL PROTECTED] (Ken Foskey) wrote: > > > On Sat, 2007-09-08 at 16:52 -0700, [EMAIL PROTECTED] wrote: > > > How would I make a script that gets a list of all the computer names > > > and ip addresses, internal 192.168..., of the co

Re: want to make a list of all users connected to a network

2007-09-09 Thread Ron Bergin
On Sep 8, 4:52 pm, [EMAIL PROTECTED] wrote: > How would I make a script that gets a list of all the computer names > and ip addresses, internal 192.168..., of the computers attached to my > wired network? Or is there a program that will do this already? Thanks The program that you're looking for i

Re: Parsing qmail-qread data

2007-09-02 Thread Ron Bergin
On Aug 31, 6:05 pm, [EMAIL PROTECTED] (Chris E. Rempola) wrote: > I'm trying to parse qmail-qread data, but don't know how to find the > number of occurrences after a particular string. Here is the data: > > +++ Beginning of data + > 28 Aug 2007 17:0

  1   2   3   4   >