can perl program do this?

2008-07-30 Thread Richard Lee
say I have big wireshark file based on remote server. I want to logon to that server and using Net::Pcap to poke the file and only grep out small portion of information which meets my criteria. Remote server won't have Net::Pcap installed. I wanted to write this program w/ Expect modules and N

Unable to read the string

2008-07-30 Thread Arun
Hi this is Arun here, i am new to perl.Here i am trying to read a string from the serial port but i am not able to and this is my program: # Read serial port until message or timeout occurs sub ReadPort($$$) { (my $String, my $TimeOut, my $Display) = @_; $ob->read_const_time($TimeOut); # S

Problems w/ MVS::JESFTP.pm

2008-07-30 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Running the following script: my $MyJES = MVS::JESFTP->open($MyHost, $MyLogonId, $MyPw) or die; printf "open to MVS completed w/o error\n"; if ( ! defined $MyJES->submit($MyJob) ) {; #$job is the absolute name of a valid jcl file printf "Problem with submission of job\n<$MyJob>\n";

Re: XS

2008-07-30 Thread Patrick Dupre
OK, it works by putting the header file at the beginig of my c file: EXTERN.h, etc. Regards Patrick Dupre wrote: Inside a c routine (ie. inside a .c file) is there any way to define a variable of type SV (or SV *) ? From xs, it is no problem. Yes. You can say SV *var = &PL_sv_undef; whic

Re: XS

2008-07-30 Thread Patrick Dupre
On Wed, 30 Jul 2008, Rob Dixon wrote: Patrick Dupre wrote: Inside a c routine (ie. inside a .c file) is there any way to define a variable of type SV (or SV *) ? From xs, it is no problem. Yes. You can say SV *var = &PL_sv_undef; Where should I say it ? What I want, by using a c routine

Re: XS

2008-07-30 Thread Rob Dixon
Patrick Dupre wrote: > > Inside a c routine (ie. inside a .c file) is there any way to define a > variable of type SV (or SV *) ? > From xs, it is no problem. Yes. You can say SV *var = &PL_sv_undef; which creates an undefined scalar. But what do you want to do with it? Rob -- To unsubscr

Re: XS

2008-07-30 Thread Ivan Gromov
Patrick Dupre wrote: Inside a c routine (ie. inside a .c file) is there any way to define a variable of type SV (or SV *) ? I think you need such function as :SV* newSViv ( IV i ); SV* newSVuv ( UV u ); SV* newSVnv ( NV n ) and SV* newSVpv ( char* string , STRLEN len ); (with libraries and )

Re: Evaluate an operator given as a string

2008-07-30 Thread John W. Krahn
Amit Koren wrote: Hi all. Hello, I'm trying to pass the operators ">=" or "<=" to a subroutine, and then use it inside an "if" statement. What changes should i apply to the code below to make it work ? my_evaluate ( ">="); sub my_evaluate { my ($sign) = @_; my $x = 10; my $y = 20

Re: How to get a computed string to act as a re in if statement

2008-07-30 Thread John W. Krahn
Mike Martin wrote: Hi Hello, I am working on the sub below. The aim is to create a string from values passed to the sub-routine and then use that as a if criterion for the push operation. Is this possible? [ Whitespace adjusted for clarity. ] sub get_list { my ( $black_list, $table,

XS

2008-07-30 Thread Patrick Dupre
Hello, Inside a c routine (ie. inside a .c file) is there any way to define a variable of type SV (or SV *) ? From xs, it is no problem. Regards -- --- == Patrick DUPRÉ | | Department of Chemistry

Re: reading a few bytes into a file

2008-07-30 Thread John W. Krahn
Rob Dixon wrote: use strict; use warnings; my $file = shift; open my $fh, '<', $file or die $!; print "Filename: $file"; my $buffer; my $count = read $fh, $buffer, 8 or die $!; die "Insufficient data in file" unless $count >= 8; my $dv = unpack '@4 N', $buffer; print " Value: $dv\n"; Or:

Re: Checking to see if file exists.

2008-07-30 Thread John W. Krahn
tvadnais wrote: I am totally confounded by what appears to be a bug in the "does file exist" functionality. Here is the code as it stands now: my $tmpfile = substr ($file, 0, index($file, ".pgp")); I would probably do that like this instead: ( my $tmpfile = $file ) =~ s/\.pgp\z//; print c

sitemap generator for Perl

2008-07-30 Thread bdy
Is it possible to run a site map generator with Perl without running it from the server? Basically, I want to run the sitemap generator client-side. Here's t he module I'm working with: package WWW::Sitemap; #== # # Star

Re: getting process id under NT

2008-07-30 Thread happytown
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 think it can show me the PID if > > I give the name of an existing and running Win NT application. > > > On 28 ju

RE: use of Configuration files

2008-07-30 Thread Stewart Anderson
> -Original Message- > From: mani kandan [mailto:[EMAIL PROTECTED] > Sent: 30 July 2008 17:50 > To: beginners@perl.org > Subject: use of Configuration files > > > Dear gurus, > > I want to know how to use configuration files concept in Perl, using > configuration files working with Perl

Embedding Perl in C: problem with modules

2008-07-30 Thread Ivan Gromov
Hello All. I have a problem. I need persistent Perl interpreter in my C program and a function, that can run my scripts and can make addition things with data from the script. In the function I carry out set of perlapi functions: perl_construct(), perl_parse(), perl_run and perl_destruct(). B

use of Configuration files

2008-07-30 Thread mani kandan
Dear gurus,   I want to know how to use configuration files concept in Perl, using configuration files working with Perl scripts that is using reading an input from *.ini files and if possible sample files for my reference   Regards Manikandan

Re: Regular expression: How to determine wether entry is a number?

2008-07-30 Thread Paul Lalli
On Jul 29, 12:09 pm, [EMAIL PROTECTED] (Jan-Henrik) wrote: > On 29 juil, 17:40, [EMAIL PROTECTED] (Paul Lalli) wrote: > > On Jul 29, 8:46 am, [EMAIL PROTECTED] (Jan-Henrik) wrote: > > Thank you very much for the detailed answer, I'll use it as a > reference in the future. > My case today: I just w

Re: Evaluate an operator given as a string

2008-07-30 Thread peng . kyo
On Wed, Jul 30, 2008 at 10:43 PM, Amit Koren <[EMAIL PROTECTED]> wrote: > if ($x $sign $y) { # want it to be treated as: if ($x >= $y) one way, change the line above to: if (eval "$x $sign $y") { ... } -- Regards, Jeff. - [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Evaluate an operator given as a string

2008-07-30 Thread Amit Koren
Hi all. I'm trying to pass the operators ">=" or "<=" to a subroutine, and then use it inside an "if" statement. What changes should i apply to the code below to make it work ? my_evaluate ( ">="); sub my_evaluate { my ($sign) = @_; my $x = 10; my $y = 20; if ($x $sign $y) { # want

Re: rand()

2008-07-30 Thread Rob Dixon
Bobby wrote: > > I'm passing @nums values from an html form; so now my @nums = ($list) where > $list = 97000,97005,98000,96100,94003 . The rand funtion now interprets $list > as a string and not integers so the script doesn't works anymore. How do i > convert values with that list from a string

Re: rand()

2008-07-30 Thread Chris Charley
From: ""Chris Charley"" From: "Bobby" Newsgroups: perl.beginners Subject: rand() Hi all, How do I use the rand function to print out more than one random number for an array? In the example script below i have an array @nums with a list of numbers; how do i print out more than one random

Re: Question about lwp-rget

2008-07-30 Thread Rob Dixon
bdy wrote: > > If I use lwp-rget to retrieve a Web site, will it retrieve new pages > added that may not be linked to? > > For example, the site www.123.com is composed of 10 pages, each of > which is accessible through links on the site. > > But, two pages are added in the span of three days. >

Re: How to get a computed string to act as a re in if statement

2008-07-30 Thread Rob Dixon
Mike Martin wrote: > > I am working on the sub below. > > The aim is to create a string from values passed to the sub-routine > and then use that as a if criterion for the push operation. > > Is this possible? (Code reformatted for legibility) use strict; use warnings; my %guide; get_list(u

Re: Regular expression: How to determine wether entry is a number?

2008-07-30 Thread Rob Dixon
Jan-Henrik wrote: > On 29 juil, 14:46, [EMAIL PROTECTED] (Jan-Henrik) wrote: >> Dear Group, >> >> I'm new to Perl and I have a simple question: >> >> I ask for the entry of a number vie : >> >> >> #!/usr/bin/perl -w >> use strict; >> >> my $foo; >> print "En

Re: reading a few bytes into a file

2008-07-30 Thread Rob Dixon
Scott Haneda wrote: > > Hi Rob, thanks for your reply. This is my first adventure into perl, > and I am a bit stumped. I have experience in a few web scripting > languages, but this is a little new to me. > > Your script does work, and returns a number, but not the correct one, > and I thi

Re: reading a few bytes into a file

2008-07-30 Thread Rob Dixon
Scott Haneda wrote: > Hello, I have this small C app that someone wrote for me ages ago, and > am tired of it breaking every time I move it around to various > systems, I will include it below. > > I am hoping I can do this in perl, as a one liner, were it will read a > the first 4 bytes of

How to get a computed string to act as a re in if statement

2008-07-30 Thread Mike Martin
Hi I am working on the sub below. The aim is to create a string from values passed to the sub-routine and then use that as a if criterion for the push operation. Is this possible? sub get_list { my ($black_list,$table,$crit)[EMAIL PROTECTED]; ### $crit is a hash reference containing key to s

Re: reading a few bytes into a file

2008-07-30 Thread Jenda Krynicky
From: Scott Haneda <[EMAIL PROTECTED]> > Hello, I have this small C app that someone wrote for me ages ago, and > am tired of it breaking every time I move it around to various > systems, I will include it below. > > I am hoping I can do this in perl, as a one liner, were it will read a > th