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

Re: Debugging and passing constant value at run time

2015-07-07 Thread Ron Bergin
){ say 'hello'; say 'goodbye' if $VERBOSE 1; } Ron From: Sharanbasappa Raghapur, ERS, HCLTech shar...@hcl.com To: Perl Beginners beginners@perl.org Sent: Tuesday, July 7, 2015 4:40:35 AM Subject: Debugging and passing constant value at run time Hi, I am using constant mainly to enable

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 shawnhco...@gmail.com To: beginners

Re: Make scalar tainted

2014-12-06 Thread Ron Bergin
($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 -- Ron Bergin -- To unsubscribe, e-mail: beginners

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 error messages

Re: using string as module

2014-11-08 Thread Ron Bergin
€¦ } 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::${pgm}Bar-new; -- Ron Bergin -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org

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::${pgm}Bar-new() ; that is just fine there. the class in a class

Re: Apologetic request for simple one-off script

2014-07-17 Thread Ron Bergin
-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 slice. Maybe you meant to say you wouldn't use an array slice? --- Ron Bergin

Re: Creating a hash of arrays from DATA

2014-07-10 Thread Ron Bergin
', '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: Creating a hash of arrays from DATA

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 strict; use warnings; use Data::Dumper; my

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 unsubscribe,

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';

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; use

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
; } } --- 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 script is

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

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
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
doing. That way, you could capture the stdout and stderr separately and log the stderr as WARN or ERROR. Ron Bergin -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

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 error or you

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
(); ... ... # 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
($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
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 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http

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

2012-07-13 Thread Ron Bergin
= '.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; use

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(%02d\n), $_)} Ron -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

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 r...@i.frys.com wrote: lina wrote: On Sun, Mar 11, 2012 at 10:45 PM, lina lina.lastn...@gmail.com wrote: What I have come up so far : #!/usr/bin/env perl use strict; use warnings; my $filename = try.txt; open my $fh

Re: How can I extract the lines after A

2012-03-11 Thread Ron Bergin
print $line; You'll want to skip over the 'A' and 'C' lines before printing the line. I'll leave that to you. } } Thanks -- Ron Bergin -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

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 livio.cipri...@gmail.com wrote: Hi, I'm new to Perl but old in other programming

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 many

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 %PlcyActions

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 methods

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?

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

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
);         }     }     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
Force 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 For additional commands, e-mail: beginners-h

Re: rmdir

2011-06-27 Thread Ron Bergin
folders plz suggest From: Ron Bergin r...@i.frys.com To: Irfan Sayed irfan_sayed2...@yahoo.com Cc: Shlomi Fish shlo...@shlomifish.org; pa...@laposte.net pa...@laposte.net; Perl Beginners beginners@perl.org Sent: Monday, June 27, 2011 8:39 PM Subject: Re

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 $s @_ or

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:         trapped error Bad file descriptor at trap-print-errors2.pl line 12

Re: install a package on windows

2010-12-15 Thread Ron Bergin
. 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; use

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 the same problems with their code times and times

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-elements/

Opposite benchmark results between Linux and Windows

2010-08-10 Thread Ron Bergin
: C:\TEMPtimestamp.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); use

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 don't

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 =

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 that,

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://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite

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:

Learning to 'fork()' the right way

2009-03-26 Thread Ron Smith
{ 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); exit; } else { waitpid($pid, 0); } } I

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

2009-03-16 Thread Ron Smith
:56, Ron Smith geeksatla...@yahoo.com wrote: snip Can't locate object method rvalidate via package PPM::XML::PPD::html at C:/strawberry/perl/site/lib/PPM.pm line 16 87. snip Odd, I thought the point of Strawberry Perl was to make it so that CPAN just worked on Windows and to avoid

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

2009-03-16 Thread Ron Smith
:51, Ron Smith geeksatla...@yahoo.com wrote: snip Then when I try installing 'Math::GMP' I get: snip WARNING! No GMP libraries were detected! snip Warning: No success on command[C:\strawberry\perl\bin\perl.exe Makefile.PL]  TURNSTEP/Math-GMP-2.05.tar.gz snip The Net::SSH::Perl

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

2009-03-15 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 Documentsperl -e use ExtUtils::Installed; my $inst = ExtUtils::Installed-new(); my @modules = $inst-modules(); print

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

2009-03-15 Thread Ron Smith
From: Beau E. Cox beau.e@gmail.com 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 geeksatla...@yahoo.com wrote: Hello all

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

2009-03-15 Thread Ron Smith
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 layer for Net::SSH::Perl Is this also needed; does anyone know where I've gone astray? Ron Smith geeksatla...@yahoo.com

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

2009-03-14 Thread Ron Smith
::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 do seems to work. ..any suggestions? Ron Smith geeksatla

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 just perldoc'ed it to see what it had to say: DESCRIPTION

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 involved

I'd like to monitor a running script.

2009-03-08 Thread Ron Smith
`; if ($process) { sleep 30} else { exec (./process name) or print STDERR couldn't exec process name: $!; } } 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

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 Archive::Zip at -e

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 (few

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; print

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_line); while

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, Monnappa

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 the

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: 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 options? If

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: getting process id under NT

2008-08-03 Thread Ron Bergin
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, [EMAIL PROTECTED] (Epanda) wrote: Hi HappyTown I have seen your web link but I don't

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, [EMAIL

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 end up with

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 Manager

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:\ /S`;

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/meminfo |

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/meminfo |

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 mechanism

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 add the 'our $value;' to Script.pl yes you

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 is

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 = ( apple = red,

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 Config.pl; In addition to changing

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 == #!/usr/bin/perl -w my $value = abc; In addition to changing

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. Please

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: 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 about

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 about

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? Thanks,

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 such a fashion

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 $line

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 conditions'

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 can't

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 is

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 computers

Re: Variable $i count a lot numbers...

2007-09-02 Thread Ron Bergin
On Sep 1, 5:03 pm, [EMAIL PROTECTED] (Rodrigo Tavares) wrote: Hello, I have a problem with a counter. #!/usr/bin/perl use strict; use warnings; print Write a number:; my $number= STDIN; my @array; my $div = $number * 2 ; my $i=0; while ($div 0) { $div = $div / 2;

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:00:47

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:00:47

  1   2   3   4   >