Re: Printing the contents of an array

2009-10-22 Thread Jim Gibson
At 11:21 AM +0530 10/23/09, wrote: Hi, The contents in my array looks like this... change_id="B77_ip_sync_idl" state="released" customer_rel="B77" change_name="ip_vke_sync" short_description="This feature introduces the Sync idl." planned_baseline="B77_135.00" change_id="B77_ip_sync_idl" stat

Printing the contents of an array

2009-10-22 Thread pradeepkumar.surabhi
Hi, The contents in my array looks like this... change_id="B77_ip_sync_idl" state="released" customer_rel="B77" change_name="ip_vke_sync" short_description="This feature introduces the Sync idl." planned_baseline="B77_135.00" change_id="B77_ip_sync_idl" state="accepted" customer_rel="B77" change

Re: perl like tail -f

2009-10-22 Thread Harry Putnam
Shawn H Corey writes: >> open(FILE,"<./named-pipe") or die "Can't Open ./named-pipe: $!"; >> while(){ >> print; >> if(eof){ >> sleep 2; >> seek (FILE,0,1); >> } >> } >> >> It seems at least to survive repeated restarts of system logger. >> >> If I write my script

Re: Want to write a script to note specific IP addresses.

2009-10-22 Thread John W. Krahn
hongyi.z...@gmail.com wrote: On Thursday, October 22, 2009 at 15:08, mrdanwal...@gmail.com wrote: 2009/10/19 Hongyi Zhao : I want to write a script to note specific IP Â addresses by appending the corresponding location informations. Â For I suggest you take a look at Geo::IP [0]. I've used

Re: Convert Site Name to Dotted IP Address

2009-10-22 Thread John W. Krahn
Anant Gupta wrote: I wrote #!usr/bin/perl use Socket; use constant ADDR => 'www.google.com'; my $name=shift || ADDR; $packed=gethostbyname($name); $dotted-inet_ntoa($packed); print "DOtted Address is $packed"; but it is showing an error "Bad argument length for Socket length in inet_ntoa" ???

Re: Problem with PDF::API2::Lite module

2009-10-22 Thread Dermot
2009/10/22 Dermot : > 2009/10/22 ANJAN PURKAYASTHA : >> Hi All, >> I wrote a short script to test the PDF::API2::Lite module. I work on a Mac >> OSX. >> Here is the script: >> #! /usr/bin/perl >> >> use strict; >> use warnings; >> use PDF::API2::Lite; >> >> my $pdf= PDF::API2::Lite->new; >> >> my $

Re: Convert Site Name to Dotted IP Address

2009-10-22 Thread Shlomi Fish
Hi Anant! Here's some review of your code: On Thursday 22 Oct 2009 12:23:55 Anant Gupta wrote: > I wrote > > #!usr/bin/perl > use Socket; 1. You should add "use strict;" and "use warnings;" at the top of every file. Writing programs without them is dangerous. Probably the only instance where

Re: Convert Site Name to Dotted IP Address

2009-10-22 Thread Philip Potter
2009/10/22 Anant Gupta : > Thank you. > I just used "use strict" and "use warnings" and it worked. > Even now I cant figure out what difference can this make :) > > Thank you for tour time If it helps, I have no idea either :) Philip -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For

Problem with PDF::API2::Lite module

2009-10-22 Thread ANJAN PURKAYASTHA
Hi All, I wrote a short script to test the PDF::API2::Lite module. I work on a Mac OSX. Here is the script: #! /usr/bin/perl use strict; use warnings; use PDF::API2::Lite; my $pdf= PDF::API2::Lite->new; my $img = $pdf->image_jpeg('/Users/anjan/Desktop/personal/me.jpeg'); $pdf->page($img->width,

Re: Convert Site Name to Dotted IP Address

2009-10-22 Thread Anant Gupta
Thank you. I just used "use strict" and "use warnings" and it worked. Even now I cant figure out what difference can this make :) Thank you for tour time Anant On Thu, Oct 22, 2009 at 5:19 PM, Philip Potter wrote: > 2009/10/22 Anant Gupta : > > Nopes, > > It is the same > > > > The '-' minus si

Re: Convert Site Name to Dotted IP Address

2009-10-22 Thread Philip Potter
2009/10/22 Anant Gupta : > Nopes, > It is the same > > The '-' minus sign was my mistake. > > I am using this on Red Hat Linux, but I am not the root user. > Will not being the root user make any difference? No, it won't make any difference. This is probably quite frustrating for you, but I'm not

Re: Convert Site Name to Dotted IP Address

2009-10-22 Thread Anant Gupta
Nopes, It is the same The '-' minus sign was my mistake. I am using this on Red Hat Linux, but I am not the root user. Will not being the root user make any difference? Thanks On Thu, Oct 22, 2009 at 4:33 PM, Philip Potter wrote: > 2009/10/22 Anant Gupta : > > I wrote > > > > #!usr/bin/perl >

Re: Convert Site Name to Dotted IP Address

2009-10-22 Thread Philip Potter
2009/10/22 Anant Gupta : > I wrote > > #!usr/bin/perl > use Socket; > use constant ADDR => 'www.google.com'; > my $name=shift || ADDR; > $packed=gethostbyname($name); > $dotted-inet_ntoa($packed); > print "DOtted Address is $packed"; > > but it is showing an error > "Bad argument length for Socket

Convert Site Name to Dotted IP Address

2009-10-22 Thread Anant Gupta
I wrote #!usr/bin/perl use Socket; use constant ADDR => 'www.google.com'; my $name=shift || ADDR; $packed=gethostbyname($name); $dotted-inet_ntoa($packed); print "DOtted Address is $packed"; but it is showing an error "Bad argument length for Socket length in inet_ntoa" ??? Help

Re: Want to write a script to note specific IP addresses.

2009-10-22 Thread hongyi . zhao
On Thursday, October 22, 2009 at 15:08, mrdanwal...@gmail.com wrote: > 2009/10/19 Hongyi Zhao : >> I want to write a script to note specific IP >>  addresses by appending the corresponding location informations.  For > I suggest you take a look at Geo::IP [0]. I've used it quite a few > times in t

Re: newbie question : about the perl sprintf

2009-10-22 Thread uap12
On 21 Okt, 14:52, jian...@gmail.com (Majian) wrote: > Hi, all ; > >            I want to print  this sentence " The number in scientific > notation is 1.255000e+02". > >          So   I write a perl script like this : >                #!/usr/bin/perl >                 sprintf "The number in scienti

Re: lettinf an external basgh command timeout inside eval

2009-10-22 Thread cerr
On Oct 21, 8:31 am, jimsgib...@gmail.com (Jim Gibson) wrote: > At 3:59 PM -0700 10/20/09, cerr wrote: > > >Hi, > > >I wanna execute an external bash command but timeout if it's taking > >longer than XX seconds. I've tried it like this: > >eval { > >    local $SIG{ALRM} = sub {die "alarm\n"}; > >  

Re: pcregrep match groups

2009-10-22 Thread Dan Wallis
2009/10/16 Chris Allen : > smoothly with the least amount of code.  One thing in particular is > driving me crazy - I can't figure out how to output only the contents > of my match groups with pcregrep. I'm not familiar with pcregrep, nor is my answer related to Perl, but gnu grep has an -o or --m

Re: Want to write a script to note specific IP addresses.

2009-10-22 Thread Dan Wallis
2009/10/19 Hongyi Zhao : > I want to write a script to note specific IP >  addresses by appending the corresponding location informations.  For I suggest you take a look at Geo::IP [0]. I've used it quite a few times in the past for similar tasks to what you're describing. I could supply an exampl