RE: Module Object and sub module function

2003-10-29 Thread Gupta, Sharad
Maybe OT. But just curious. What do the experts say about exporting function from OO modules??. Everytime i need something like this, i end up making those functions as Class methods. -Sharad > -Original Message- > From: Dan Muey [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 29, 2

RE: Module Object and sub module function

2003-10-29 Thread Gupta, Sharad
I guess by extension you mean that you are trying to subclass a module. In that case you would need to inherit from that parent class with something like: our @ISA = qw(ParentClass) or use base qw(ParentClass) Then you can call the methods of the parent class on the instances of this subclass

RE: FQN from references

2003-10-28 Thread Gupta, Sharad
it somehow, why to make it mandatory in the interface. -Sharad > -Original Message- > From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] > Sent: Wednesday, October 22, 2003 8:53 PM > To: Gupta, Sharad > Cc: [EMAIL PROTECTED] > Subject: Re: FQN from references &

RE: FQN from references

2003-10-22 Thread Gupta, Sharad
ns d'Anconia > Cc: Gupta, Sharad; [EMAIL PROTECTED] > Subject: Re: FQN from references > > > On Wed, Oct 22, 2003 at 08:22:47PM -0500, Wiggins d'Anconia wrote: > > Gupta, Sharad wrote: > >> Now from this coderef ($x) i want to know its fully qualified name &

RE: FQN from references

2003-10-22 Thread Gupta, Sharad
6:23 PM > To: Gupta, Sharad > Cc: [EMAIL PROTECTED] > Subject: Re: FQN from references > > > Gupta, Sharad wrote: > > Hi All, > > > > How do i know the full name of a variable from its reference??. > > > > Say i have a routine defined like this: >

FQN from references

2003-10-22 Thread Gupta, Sharad
Hi All, How do i know the full name of a variable from its reference??. Say i have a routine defined like this: package Bar; sub foo {}; And then i say: my $x = \&foo; Now from this coderef ($x) i want to know its fully qualified name which would be somthing like Bar::Foo. Is there a way to

Packaging my stuff

2003-10-03 Thread Gupta, Sharad
Hi All, I am sure people must be doing that regularly. How do i package my Application to give to the customer??. Like creating packages for different platforms linux, debian, sun, windows etc. Any pointers would be greatly appreciated. Thanx, -Sharad -- To unsubscribe, e-mail: [EMAIL PROTE

patches

2003-09-29 Thread Gupta, Sharad
Hi All, Say i give one of my application to a customer. The customer runs it and finds a bug in there. I don't want to give a fixed application again to the customer and ask him to go through the pain of installing it again. Instead i create a patch and tell customer to install that patch.

RE: Silly question

2003-09-26 Thread Gupta, Sharad
Thank you. -Sharad -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2003 10:20 PM To: Gupta, Sharad Cc: [EMAIL PROTECTED] Subject: Re: Silly question On Sep 22, Gupta, Sharad said: > package Foo; >

Silly question

2003-09-22 Thread Gupta, Sharad
Hi ALL, I know i am missing something somewhere: perl -e ' package Foo; use overload q("") => sub {return shift->{bar}}; $s = bless{bar=>"hello"}, Foo; print "$s\n" ' prints "hello". Whereas: perl -e '

Net::SSH::Perl

2003-09-18 Thread Gupta, Sharad
Hi All, I remember i read somewhere about some limitations of Net::SSH::Perl on windows systems particularly something about 5.8 but can't find the link now. Can anybody point me to it without much effort.?? Thanx, -Sharad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

mapping usernames in unix/windows

2003-08-29 Thread Gupta, Sharad
Hi Friends, Any suggestions on how one can map usernames between unix/windows machines. Eg: Administrator->root Any modules/thoughts??. -Sharad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

sending interrupt

2003-08-27 Thread Gupta, Sharad
Hi all, Any ideas on how do i send an interrupt signal to the connection made via Net::Telnet. Thanx, -Sharad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: TRYING AGAIN (was: Net::Telnet)

2003-08-24 Thread Gupta, Sharad
Thanx a lot for replying. I am telnetting from a windows machine to a unix machine. Comparing the installations seems to be an idea. I'll also try from the XP machine. Thanx again, -Sharad >-Original Message- >From: Rob Dixon [mailto:[EMAIL PROTECTED] >Sent: Sunday, August 24, 2003

TRYING AGAIN (was: Net::Telnet)

2003-08-23 Thread Gupta, Sharad
I am sure somebody would have a magical touch for me. -Sharad -Original Message- From: Gupta, Sharad Sent: Saturday, August 16, 2003 9:03 PM To: [EMAIL PROTECTED] Subject: Net::Telnet Hi All, I have a small script like this

Net::Telnet

2003-08-16 Thread Gupta, Sharad
Hi All, I have a small script like this: --- use strict; use Net::Telnet; my $host = "Wilma"; my $username = "Foo"; my $pass = "Bar"; my $s = Net::Telnet->new( Host=>$host, input_log => "input_log",

http paths in @INC

2003-08-14 Thread Gupta, Sharad
Hi All, Can i have something like "http:://Somepath" in @INC. -Sharad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Ok I am tired

2003-08-14 Thread Gupta, Sharad
7;t find the module. -Sharad -Original Message- From: Steve Grazzini [mailto:[EMAIL PROTECTED] Sent: Saturday, August 09, 2003 10:32 PM To: Gupta, Sharad Cc: [EMAIL PROTECTED] Subject: Re: Ok I am tired On Sat, Aug 09, 2003 at 08:57:54PM -0700, Gupta, Sharad wrote: >> You're s

RE: Ok I am tired

2003-08-14 Thread Gupta, Sharad
Ok all I/O works with this filehandle, but seems like require don't like it. Any ideas why??. -Sharad -Original Message- From: Gupta, Sharad Sent: Sunday, August 10, 2003 12:59 PM To: Steve Grazzini Cc: [EMAIL PROTECTED] Subject: RE: Ok I am tired >> IO::Stringy (non-core

RE: Ok I am tired

2003-08-14 Thread Gupta, Sharad
Ur examples are cool. I never knew i can do that. But my problem was: I was trying to port some of my scripts to Windows. I know i can get all of the modules which my already written scripts would be using via http. And i did'nt wanted to map the drive on *all* the windows mach

RE: Ok I am tired

2003-08-14 Thread Gupta, Sharad
And now my script looks like: - #!/usr/local/bin/perl use Foo; use Bar; --- And it works!! -:). Please let me know for if u have better ideas. Thanx, -Sharad -----Original Message- From: Gupta, Sharad Sent: Friday, August 08, 2003 10:50 PM To: [E

Ok I am tired

2003-08-14 Thread Gupta, Sharad
Hi All, I am really tired now: -- package Foo; use strict; use LWP::UserAgent; sub new { return bless {},shift; } sub Foo::INC { my ($self,$filename) = @_; my @paths = "http:/me.com"; my @urls = map{$_ . "/" . [EMAIL PROTECT

RE: Look Ahead

2003-08-14 Thread Gupta, Sharad
In the @x i am expecting to get all the http paths just like u showed in ur example. This should work fine. Thanx, -Sharad -Original Message- From: Todd W. [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 9:32 PM To: [EMAIL PROTECTED] Subject: Re: Look Ahead "Sharad Gupta

Tracing Subs

2003-08-14 Thread Gupta, Sharad
Hi All, I have a bunch of scripts which calls a sub from a module, and that module in turn would call another sub from someone else and so on. Skimming through them is driving me crazy. Is there a way i can trace the calling of the routines till N levels. TIA, -Sharad

RE: Tracing Subs

2003-08-14 Thread Gupta, Sharad
. -Sharad -Original Message- From: Ramprasad [mailto:[EMAIL PROTECTED] Sent: Saturday, August 09, 2003 12:41 AM To: Gupta, Sharad Cc: [EMAIL PROTECTED] Subject: Re: Tracing Subs Sharad Gupta wrote: > Hi All, > > I have a bunch of scripts which calls a sub from a module, and that

RE: Ok I am tired

2003-08-11 Thread Gupta, Sharad
ect itself. (Note that you must fully qualify the sub's name, as it is always forced into package main.) Thanx, -Sharad -Original Message- From: Steve Grazzini [mailto:[EMAIL PROTECTED] Sent: Saturday, August 09, 2003 1:51 PM To: Gupta, Sharad Cc: [EMAIL PROTECTED] Subject: Re: Ok

Look Ahead

2003-08-07 Thread Gupta, Sharad
Hi All, I have a path like: $s = "http::/foo/bar:http::/foo1/bar1:http/foo1/bar1"; I am trying to get all the http paths which are seperated by ":" like this: @x = ($s =~ /(http::.*?):(?=http::.*?)/g) The problem is i get all the elements in @x except the last one. Where is that??. -Sharad

RE: http paths in @INC

2003-08-07 Thread Gupta, Sharad
Yep, the "require" doc says that clearly. I should have read it first before posting. Just got things working ;) -Sharad -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 6:00 PM To: Gupta, Sharad; [EMAIL PROTECTED] Subject

RE: Splitting a path

2003-08-04 Thread Gupta, Sharad
s it would print the whole Foo instead of printing 2 elements C:\foo\bar and D:\foo\bar, because the $Config::Config(path_sep) is not ":" on windows. -Sharad > -Original Message- > From: Steve Grazzini [mailto:[EMAIL PROTECTED] > Sent: Saturday, August 02, 2003 4

RE: Splitting a path

2003-08-02 Thread Gupta, Sharad
PROTECTED] Sent: Saturday, August 02, 2003 3:12 PM To: Gupta, Sharad Cc: [EMAIL PROTECTED] Subject: Re: Splitting a path It was Saturday, August 02, 2003 when Gupta, Sharad took the soap box, saying: : : Hi, : : I have a path which may look like: use Env [EMAIL PROTECTED]; print "$_\

Splitting a path

2003-08-02 Thread Gupta, Sharad
Hi, I have a path which may look like: UNIX: - PATH=/usr/local/share:/usr/local:... Where each path is seperated by ":". Windows: -- PATH=E:\foo:D:\bar Again the path seperated by ":". ( I cannot change the seperator ) How can i split the path on ":" which gives m

RE: Porting perl scripts on windows

2003-07-16 Thread Gupta, Sharad
Ok, Let me try to put it the other way. Any good books on how to learn perl on windows??. Thanx, -Sharad -Original Message- From: Gupta, Sharad Sent: Wednesday, July 16, 2003 12:41 PM To: [EMAIL PROTECTED] Subject: Porting perl scripts on windows Hello Friends, I have always been

Porting perl scripts on windows

2003-07-16 Thread Gupta, Sharad
Hello Friends, I have always been on Unix and perl. Now i wanted to port some of my scripts to Windows. Any pointers to web/books for understanding the implications is appreciated?? TIA, -Sharad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: joining keys

2003-07-11 Thread Gupta, Sharad
Aha! Thanx to all for help. I did'nt realized i can do it like this yesterday. So i created a small routine and passed the keys through it at the time of creation itself. I'll try it. Thanx, -Sharad -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Friday, July 11, 200

joining keys

2003-07-10 Thread Gupta, Sharad
Hi Friends, I have a hash whose values can be either array, hash etc. say i have: my $self = { 'hello how' => { 'r u' => 'I am',

RE: convertion bash script to perl

2003-07-09 Thread Gupta, Sharad
perldoc -q "How can i convert my shell script to perl" -Sharad -Original Message- From: thyagarajan k [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 6:00 AM To: [EMAIL PROTECTED] Subject: convertion bash script to perl Hello friends, i am quite new to perl and currently i hav

RE: $! and $@

2003-07-08 Thread Gupta, Sharad
$! is the oserror. $@ contains the exceptions thrown by eval. Eg: use strict; my $out = get_list(); if($@) { print "Could not get the list: $@"; } sub get_list { # If we die return the error set in [EMAIL PROTECTED] eval { # If we are unabl

RE: map() returns scalar value instead of match string?

2003-07-08 Thread Gupta, Sharad
I think u would need the "grep" function here instead of "map". Map returns the results of the evaluation of expression which is '1' in ur case because u matched. Grep returns the actual elements of the list for which the expression was true. try: my @ptrRecords = grep{/.*\s+PTR\s+.*/[EMAIL PRO

RE: Reference Hash to an array

2003-07-07 Thread Gupta, Sharad
If i get it right, ur structure looks like: my $ref = { key1 => [qw(v1 v2...)], key2 => ... }; one can do. foreach my $key(keys %$ref) { print "$key: @{$ref->{$key}}\n"; } -sharad -Original Message- From: Gene Mat [mailto:[EMAIL P

RE: Data Structure Question

2003-07-07 Thread Gupta, Sharad
Instead of: print "obj:$obj->order_number($order_num)\n"; Try: print "obj: " . $obj->order_number($order_num) . "\n"; If u use a reference as a string it would give its reference type, the package and the location. -sharad -Original Message- From: Trevor Morrison [mailto:[EMAIL PROT

RE: Data Structures in Perl

2003-07-06 Thread Gupta, Sharad
>From ur example i assume that: my @order is an array collecting all of the objects with each order. So, instead of my @order = new miva_order; we mean to say: my @orders; my $obj = new miva_order; $obj->order_number(get_order_num_via_regex()); push @orders,$obj; for (my $w=0;$w<=$#orders;$w

RE: Regex or Looping problem ?

2003-06-29 Thread Gupta, Sharad
My first guess is that '.' being a metacharacter u would need to escape it somehow. something like this: foreach my $filter_key(@FFW) { $filter_key = quotemeta($filter_key); } -Sharad -Original Message- From: LI NGOK LAM [mailto:[EMAIL PROTECTED] Sent: Sunday, June

RE: File Handles in subroutines

2003-06-25 Thread Gupta, Sharad
Did open ever succeeded?? Check with: open(FILE,">>$logfile") or die "$!"; -sharad -Original Message- From: Scott, Joshua [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 11:13 PM To: [EMAIL PROTECTED] Subject: File Handles in subroutines What do I need to do in order t

RE: basic question: handling input to TCP/IP server

2003-06-24 Thread Gupta, Sharad
quot;. -Sharad -----Original Message- From: Gupta, Sharad Sent: Monday, June 23, 2003 3:36 PM To: 'McMahon, Christopher x66156'; [EMAIL PROTECTED] Subject: RE: basic question: handling input to TCP/IP server Something like this worked for me in the past: use strict; use IO::S

RE: Reading from STDIN from a pipe

2003-06-24 Thread Gupta, Sharad
Sorry for the mistake. It should look like: sub parse { while .. } -Sharad -Original Message- From: Gupta, Sharad Sent: Tuesday, June 24, 2003 5:58 PM To: Jeff Westman; beginners Subject: RE: Reading from STDIN from a pipe try doing this: sub { while ... } Look for

RE: Reading from STDIN from a pipe

2003-06-24 Thread Gupta, Sharad
try doing this: sub { while ... } Look for the removed "()" around the declaration for sub, and u won't tell the sub that it takes no arguments. -Sharad -Original Message- From: Jeff Westman [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 3:23 PM To: beginners Subject: R

RE: basic question: handling input to TCP/IP server

2003-06-23 Thread Gupta, Sharad
Something like this worked for me in the past: use strict; use IO::Socket::INET; my $sock = IO::Socket::INET(); while(1) { my $output; my $n = sysread($sock,$output,1000); last if(!defined($n)); print STDOUT $output; } And using syswrite() for writing. perldo

RE: HASH PROBLEM!!

2003-06-20 Thread Gupta, Sharad
Somewhere in the "perldoc -f exists" i read: Although the deepest nested array or hash will not spring into existence just because its existence was tested, any intervening ones will. Thus

RE: Removing entries from an array

2003-06-20 Thread Gupta, Sharad
> my $random_key = ( keys %tips )[ rand keys %tips ]; > Can anyone parse this line for me? Picking up a random key from the keys of a hash. see perldoc -f rand >>One more thing - I don't seem to have perldoc installed, I simply look up >>the functions in the info node `perlfunc'. Am I missing

RE: perldoc - html format ?

2003-06-20 Thread Gupta, Sharad
just yesterday i used: pod2html. Seems to work good. -Sharad -Original Message- From: Jeff Westman [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2003 11:34 AM To: beginners Subject: perldoc - html format ? Hi, Is it possible to reformat a perldoc in HTML format? I don't see this a

RE: compare, checking and listing

2003-06-14 Thread Gupta, Sharad
t what u are trying to do with every element of @modify?? Thanx, -Sharad -Original Message- From: Boon Chong Ang [mailto:[EMAIL PROTECTED] Sent: Saturday, June 14, 2003 1:38 AM To: Gupta, Sharad; [EMAIL PROTECTED] Subject: RE: compare, checking and listing Hi, This is the scrip

RE: compare, checking and listing

2003-06-13 Thread Gupta, Sharad
One way: To find out elements which are in test2 and not in test1: #!-*-perl-*- use strict; my @test1 = qw(1 2 3 4); my @test2 = qw(1 2 5 6 7 8); foreach my $element(@test2) { print $element if([EMAIL PROTECTED]); } -Sharad -Original Message- From: Boon Chong Ang [mailto:[EM

RE: Illegal seek

2003-06-10 Thread Gupta, Sharad
R. Joseph Newton [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 10:42 PM To: Gupta, Sharad Cc: [EMAIL PROTECTED] Subject: Re: Illegal seek "Gupta, Sharad" wrote: > While running this: > > my $new = "/newtests/new "; > $new .= &q

RE: Illegal seek

2003-06-07 Thread Gupta, Sharad
Rather i should say: It died in the below qx with this error: Illegal seek at ././job.pl line 316 -Sharad -Original Message- From: Gupta, Sharad Sent: Friday, June 06, 2003 11:52 AM To: [EMAIL PROTECTED] Subject: RE: Illegal seek While running this: my $new

RE: Illegal seek

2003-06-06 Thread Gupta, Sharad
While running this: my $new = "/newtests/new "; $new .= "\'$fields{public}\' \'$fields{sev}\' \'$fields{pri}\' "; $new .= "\'$fields{cc}\' \'$fields{bug_rel}\' \'$fields{type}\' "; $new .= "\'$fields{title}\' \'$fields{description}\' \'$fields

pseudohash

2003-06-03 Thread Gupta, Sharad
Hi All, I was looking for a pointer on the web to understand them, something like a tutorial. Any help is appreciated. Thanx, -Sharad