installing perl 5.8

2004-03-05 Thread Nilay Puri, Noida
Hi ,

I have perl 5.005_03 on Sun SOlaris installed at /usr/bin and
/usr/local/bin.

I need to install perl.

I want to know
1. From where to get the the perl 5.8
2. Which is the best place to install on the sun solaris.
3. Are there any precautions to be taken whicle installing. ( since
i alread have perl )
4. Do i have to install all the required(my project specific) perl
module which i had earlier installed at /usr/local/bin/,  again after
installing perl 5.8

Thanks


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Checking filenames? [:: ?Kinda Solved? ::]

2004-03-05 Thread WC -Sx- Jones
John W. Krahn wrote:

chomp(my $userid = `/usr/ucb/whoami` || `/usr/bin/whoami` || 'root');

Why not use $< to find out who you are?


because in the original exercise (OP) I was showing how to greatly 
simplify a chain of possible failure and still have a usable outcome.

Maybe root wasnt a great choice maybe I could have just said:

$rawstats = (`/usr/bin/prstat -u sx 0 1`
  || `/usr/local/bin/top -b -Usx `
  || 'none for system');
Point being - make sure program paths are set.
-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: Passing Data Between Servers

2004-03-05 Thread David le Blanc

Aha!

I always wanted to rewrite MQSeries.  This might be the
opportunity!


Do you want to use TCP SOCKETS, or can you 'email' the data
to the other server?

I ask, because TCP-SOCKETS depend on evrything being available
at the time you want it, and you have to handle your own 
connection problems manually.  If you can email the data, you
have a proven delivery mechanism to base the rest of your code
on.

Then your server code is run by placing '|myperlcode -w' into 
a '.forward' files.
 

Regards,

David le Blanc

--  
Senior Technical Specialist 
I d e n t i t y   S o l u t i o n s 

Level 1, 369 Camberwell Road, Melbourne, Vic 3124   
Ph 03 9813 1388 Fax 03 9813 1688 Mobile 0417 595 550
Email [EMAIL PROTECTED] 
 

> -Original Message-
> From: Paul Kraus [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 5 March 2004 7:38 AM
> To: 'perl'
> Subject: Passing Data Between Servers
> 
> > I have a sco server which I hate to work on and I do not 
> have full admin
> > rights to. (We don't own it).
> > 
> > I would like to be able to take any data that is sent to a 
> perl script and
> > then just send out to another perl script that would be 
> waiting to accept
> > it.
> > 
> > Then based on the contents of input lunch another perl 
> script and send in
> > the data.
> > 
> > I know this is vague but I will give you a for instance.
> > 
> > Are archaic software is going to print an order out to a 
> text file that is
> > piped rather then written to a perl script. I want that the 
> script to then
> > send it to my linux server (Maybe with a daemon or 
> something just waiting
> > for input) which then would see it read the first line 
> which tell it that
> > hey we need to parse this data into this postscript 
> template and then send
> > it off using sendfax(Hylafax). That parsing and send would 
> be its own
> > script.
> > 
> > The linux server would need to be able to accept more then 
> 1 "transaction"
> > at a time.
> > 
> > Any help would be greatly appreciated.
> > 
> > TIA,
> > 
> >  Paul Kraus
> >  ---
> >  PEL Supply Company
> >  Network Administrator
> >  ---
> >  800 321-1264 Toll Free
> >  216 267-5775 Voice
> >  216 267-6176 Fax
> >  www.pelsupply.com
> >  ---
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: installing perl 5.8

2004-03-05 Thread WC -Sx- Jones
Nilay Puri, Noida wrote:
Hi ,

I have perl 5.005_03 on Sun SOlaris installed at /usr/bin and
/usr/local/bin.
What version of Sun Solaris?
Is Perl installed as a pkg, did it come with the OpSys install?

I need to install perl.

I want to know
1. From where to get the the perl 5.8
5.8.3 basics at:
http://sunfreeware.com/programlistsparc9.html#perl
	2. Which is the best place to install on the sun solaris.
/usr/local/bin is standard.

3. Are there any precautions to be taken whicle installing. ( since
i alread have perl )
Well, are you replacing a production system?  There are probably many 
things you should look at first -

Are you using any custom Perl modules?  If so, then they will all need 
to be re-installed IF you choose to use the Sunfreeware package I 
mentioned earlier.

IF you compile 5.8.3 from source then - no - you will not have to 
re-install any user local packages ONLY those in /usr/bin path.

HOWEVER, IMHO of using Perl on Solaris since 2.5.0, I would greatly with 
much emphasis state that you probably will *want* to clean out the old 
Perl and re-install a fresh copy -- but thats just me.

You should really see why you have TWO sets of Perl on your system -- 
that will go a long ways to helping us (the beginners perl list members) 
help you choose an appropriate upgrade path which will cause the least 
amount of headaches.


4. Do i have to install all the required(my project specific) perl
module which i had earlier installed at /usr/local/bin/,  again after
installing perl 5.8


Heh, see my answers in Q3 above.  :)

-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Passing Data Between Servers

2004-03-05 Thread WC -Sx- Jones
David le Blanc wrote:
Aha!

I always wanted to rewrite MQSeries.  This might be the
opportunity!
Do you want to use TCP SOCKETS, or can you 'email' the data
to the other server?
I ask, because TCP-SOCKETS depend on evrything being available
at the time you want it, and you have to handle your own 
connection problems manually.  If you can email the data, you
have a proven delivery mechanism to base the rest of your code
on.

Then your server code is run by placing '|myperlcode -w' into 
a '.forward' files.
 

Regards,

David le Blanc

--	 	
Senior Technical Specialist  	 	
I d e n t i t y   S o l u t i o n s	
	
Level 1, 369 Camberwell Road, Melbourne, Vic 3124	
Ph 03 9813 1388 Fax 03 9813 1688 Mobile 0417 595 550
Email [EMAIL PROTECTED]	
 


-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED] 
Sent: Friday, 5 March 2004 7:38 AM
To: 'perl'
Subject: Passing Data Between Servers


I have a sco server which I hate to work on and I do not 
have full admin

rights to. (We don't own it).


I vote for e-mail and less top-posting  =)

#!/usr/local/bin/perl -w

use strict;
use warnings;
# Dont create a mail-loop
my $REPLY_TO = '[EMAIL PROTECTED]';
use Mail::Internet ();

my ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime;
my $lt = sprintf("%02d%02d%02d%02d%02d%4d%d",
$sec, $min, $hour, $mday, ++$mon, ($year + 1900), $wday);
my $slt  = scalar localtime;

my $fh;   $fh = \*STDIN;

my $from;

my $msg = Mail::Internet->new($fh, 'Modify' => 0, 'MailFrom' => 'KEEP');

# Get all headers and body stuff...
my @headers = @{$msg->head()->header()};
my @body = @{$msg->body()};
my @message = ("The below message was seen by this sourcer:\n",
"This mailing was received on $slt\n",
"Serial: $lt.\n\n",
"=== The message's E-Mail Header, as sent:\n\n",
@headers,
"\n=== The message's E-Mail Body, as sent:\n\n",
@body,
"\n\n=== End of Message ===\n\n",
);
# Send to Internal Staff (you, possibly)...
$msg = $msg->reply();
$msg->body([EMAIL PROTECTED]);
$msg->head()->replace('From', $from);
$msg->head()->replace('Reply-To', $REPLY_TO);
$msg->head()->replace('To', $REPLY_TO);
$msg->smtpsend();
# Exit before we drop into other routines...
exit;
__END__

Attach this script to any UserID except postmaster or root...

-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: Handling blank lines in while() construct

2004-03-05 Thread David le Blanc
> From: Michael Weber [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 5 March 2004 2:16 AM
> To: [EMAIL PROTECTED]
> Subject: Handling blank lines in while() construct
> 
> I wrote a perl script that adds colors to text streams on the 
> fly.  It's
> really handy for watching log files as they run past. I watch my mail
> log files after making config changes and can mark "reject" in red,
> "spam" in blue, discard is red and my console beeps, etc.  It's REALLY
> nice.
> 
> However, in the configuration file, the script balks if there is a
> blank line in it.  My script reads the config file into an 
> array before
> beginning to parse any data.  If there is a blank line, it gives this
> error:
> 
> Use of uninitialized value in pattern match (m//) at
> /usr/local/bin/filter.pl line 43,  line 10.
> 

Ok, which line is line 43?

I would suggest that you simply loop when detecting an empty line.

All my config file readers (since they are all different :-( )
have
next if /^$/;
and
next if /^#/;
to skip blank lines, and comment lines.

Note that the above assumes you have 'chomp()'ed the imput
otherwise the '/m' option is required.

> I can probably come up with a kludge to get it to work, but 
> what is the
> correct "perl" way to handle it?
> 
> Here's the loop where I read in the config file:
> 
> open (CONF, $ARGV[0]) || die "Can't open config file $ARGV[0], $!\n";
> 
> while () {
> @conf_line=split(",");
> 
> push(@trigger_array, "$conf_line[0]");
> if ( $conf_line[1] =~ "red" ) {push(@color_array, "$red")}
> elsif ( $conf_line[1] =~ "yellow" ) {push(@color_array,
> "$yellow")}
> elsif ( $conf_line[1] =~ "blue" ) {push(@color_array,
> "$blue")}
> elsif ( $conf_line[1] =~ "green" ) {push(@color_array,
> "$green")}
> elsif ( $conf_line[1] =~ "cyan" ) {push(@color_array,
> "$cyan")}
> elsif ( $conf_line[1] =~ "purple" ) {push(@color_array,

Do you realise that this will match 'alonglinewiththewordpurpleinit'
and that includes 'ltpurple' which you think gets matched below??

Do you intentionally use the pattern match operator '=~' against
a string?  This is actually a substring match, hence
$conf_line[1] =~ "cyan" will match cyan AND ltcyan!!


> "$purple")}
> elsif ( $conf_line[1] =~ "gray" ) {push(@color_array,
> "$gray")}
> elsif ( $conf_line[1] =~ "ltred" ) {push(@color_array,
> "$ltred")}
> elsif ( $conf_line[1] =~ "yellow" ) {push(@color_array,
> "$yellow")}
> elsif ( $conf_line[1] =~ "ltblue" ) {push(@color_array,
> "$ltblue")}
> elsif ( $conf_line[1] =~ "ltgreen" ) {push(@color_array,
> "$ltgreen")}
> elsif ( $conf_line[1] =~ "ltcyan" ) {push(@color_array,
> "$ltcyan")}

will never match..

> elsif ( $conf_line[1] =~ "ltpurple" ) {push(@color_array,

and again..


> "$ltpurple")}
> elsif ( $conf_line[1] =~ "white" ) {push(@color_array,
> "$white")}
> elsif ( $conf_line[1] =~ "ltgray" ) {push(@color_array,
> "$ltgray")}
> elsif ( $conf_line[1] =~ "beep" ) {push(@color_array,
> "$beep")}
> else  {push(@color_array, "$white")}
> }

May I suggest:
%color_map = ();

@color_map{ qw( red yellow green blue ) } =
( $red, $yellow, $green, $blue );

Then when comparing :-

push @color_array, (defined $conf_line[1] && 
exists $color_map{$conf_line[1])) ?
$color_map{$conf_line[1]):
$white;

I'd love you to post the finished product.  Please put the
color information in a config file in a section based on
terminal type.   I would like to use it on vt320 vt100, xterm 
and linux console :-)

Cheers.

> 
> close (CONF);
> 
> BTW.  If anyone wants this script, I will re-post it after fixing this
> bug.  I gave it as a gift to this list last year as a present for all
> the help I get from y'all.
> 
> Thanx!
> 
> -Michael
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Passing Data Between Servers

2004-03-05 Thread NYIMI Jose (BMB)
Good input David ...

Paul,
You should ask yourself which kind of communication you want between your *client* and 
*server*:
Synchronous or Asynchronous ?

I will personally choose an asynchronous communication for this kind of needs.
(client doesn't need to wait a reply from server).

José.

-Original Message-
From: David le Blanc [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 05, 2004 9:59 AM
To: perl
Subject: RE: Passing Data Between Servers



Aha!

I always wanted to rewrite MQSeries.  This might be the opportunity!


Do you want to use TCP SOCKETS, or can you 'email' the data
to the other server?

I ask, because TCP-SOCKETS depend on evrything being available at the time you want 
it, and you have to handle your own 
connection problems manually.  If you can email the data, you have a proven delivery 
mechanism to base the rest of your code on.

Then your server code is run by placing '|myperlcode -w' into 
a '.forward' files.
 

Regards,

David le Blanc

--  
Senior Technical Specialist 
I d e n t i t y   S o l u t i o n s 

Level 1, 369 Camberwell Road, Melbourne, Vic 3124   
Ph 03 9813 1388 Fax 03 9813 1688 Mobile 0417 595 550
Email [EMAIL PROTECTED] 
 

> -Original Message-
> From: Paul Kraus [mailto:[EMAIL PROTECTED]
> Sent: Friday, 5 March 2004 7:38 AM
> To: 'perl'
> Subject: Passing Data Between Servers
> 
> > I have a sco server which I hate to work on and I do not
> have full admin
> > rights to. (We don't own it).
> > 
> > I would like to be able to take any data that is sent to a
> perl script and
> > then just send out to another perl script that would be
> waiting to accept
> > it.
> > 
> > Then based on the contents of input lunch another perl
> script and send in
> > the data.
> > 
> > I know this is vague but I will give you a for instance.
> > 
> > Are archaic software is going to print an order out to a
> text file that is
> > piped rather then written to a perl script. I want that the
> script to then
> > send it to my linux server (Maybe with a daemon or
> something just waiting
> > for input) which then would see it read the first line
> which tell it that
> > hey we need to parse this data into this postscript
> template and then send
> > it off using sendfax(Hylafax). That parsing and send would
> be its own
> > script.
> > 
> > The linux server would need to be able to accept more then
> 1 "transaction"
> > at a time.
> > 
> > Any help would be greatly appreciated.
> > 
> > TIA,
> > 
> >  Paul Kraus
> >  ---
> >  PEL Supply Company
> >  Network Administrator
> >  ---
> >  800 321-1264 Toll Free
> >  216 267-5775 Voice
> >  216 267-6176 Fax
> >  www.pelsupply.com
> >  ---
> 
> 
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]  





 DISCLAIMER 

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Handling blank lines in while() construct

2004-03-05 Thread David le Blanc
> -Original Message-
> From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 5 March 2004 4:16 AM
> To: Michael Weber
> Cc: [EMAIL PROTECTED]
> Subject: Re: Handling blank lines in while() construct
> 
> As far as this:
> 
> "$yellow")}
>  elsif ( $conf_line[1] =~ "blue" ) {push(@color_array,
> 
> Why not just:
> 
> sub push_Colors() {
>   my $color = shift;
>   push(@color_array,$color)
> }
> 
> Called like:
> 
> push_Colors($conf_line[1]);


I thought he was pushing '$yellow' when he found 'yellow'.  

Your code would just push the word found (ie, literal 'yellow')

I think...

One of us is confused ;-)










> 
> Unless of course your data input just has a color embedded:
> sometextcolorredorbluebutwhoknows...
> 
> HTH;
> -Bill-
> __Sx__
> http://youve-reached-the.endoftheinternet.org/
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Passing Data Between Servers

2004-03-05 Thread David le Blanc
> -Original Message-
> From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 5 March 2004 8:19 PM
> To: perl
> Subject: Re: Passing Data Between Servers
> 
> David le Blanc wrote:
> > Aha!
> > 
> > I always wanted to rewrite MQSeries.  This might be the
> > opportunity!
> > 
> > 
> > Do you want to use TCP SOCKETS, or can you 'email' the data
> > to the other server?
> > 
> > I ask, because TCP-SOCKETS depend on evrything being available
> > at the time you want it, and you have to handle your own 
> > connection problems manually.  If you can email the data, you
> > have a proven delivery mechanism to base the rest of your code
> > on.
> > 
> > Then your server code is run by placing '|myperlcode -w' into 
> > a '.forward' files.
> >  
> > 
> > Regards,
> > 
> > David le Blanc
> > 
> > --  
> > Senior Technical Specialist 
> > I d e n t i t y   S o l u t i o n s 
> > 
> > Level 1, 369 Camberwell Road, Melbourne, Vic 3124   
> > Ph 03 9813 1388 Fax 03 9813 1688 Mobile 0417 595 550
> > Email [EMAIL PROTECTED] 
> >  
> > 
> > 
> >>-Original Message-
> >>From: Paul Kraus [mailto:[EMAIL PROTECTED] 
> >>Sent: Friday, 5 March 2004 7:38 AM
> >>To: 'perl'
> >>Subject: Passing Data Between Servers
> >>
> >>
> >>>I have a sco server which I hate to work on and I do not 
> >>
> >>have full admin
> >>
> >>>rights to. (We don't own it).
> 
> 
> I vote for e-mail and less top-posting  =)
> 
> #!/usr/local/bin/perl -w
> 
> use strict;
> use warnings;
> 
> # Dont create a mail-loop
> my $REPLY_TO = '[EMAIL PROTECTED]';
> 
> use Mail::Internet ();
> 
> my ($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime;
> my $lt = sprintf("%02d%02d%02d%02d%02d%4d%d",
>  $sec, $min, $hour, $mday, ++$mon, ($year + 1900), $wday);
> 
> my $slt  = scalar localtime;
> 
> my $fh;   $fh = \*STDIN;
> 
> my $from;
> 
> my $msg = Mail::Internet->new($fh, 'Modify' => 0, 'MailFrom' 
> => 'KEEP');
> 
> # Get all headers and body stuff...
> my @headers = @{$msg->head()->header()};
> my @body = @{$msg->body()};
> 
> my @message = ("The below message was seen by this sourcer:\n",
>  "This mailing was received on $slt\n",
>  "Serial: $lt.\n\n",
>  "=== The message's E-Mail Header, as sent:\n\n",
>  @headers,
>  "\n=== The message's E-Mail Body, as sent:\n\n",
>  @body,
>  "\n\n=== End of Message ===\n\n",
>  );
> 
> # Send to Internal Staff (you, possibly)...
> $msg = $msg->reply();
> $msg->body([EMAIL PROTECTED]);
> 
> $msg->head()->replace('From', $from);
> $msg->head()->replace('Reply-To', $REPLY_TO);
> $msg->head()->replace('To', $REPLY_TO);
> $msg->smtpsend();
> 
> # Exit before we drop into other routines...
> exit;
> 
> __END__
> 
> 
> Attach this script to any UserID except postmaster or root...
> 
> -Bill-
> __Sx__
> http://youve-reached-the.endoftheinternet.org/
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 
> 


Sorry about the top posting :")



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Perl script to switch user to root.

2004-03-05 Thread David le Blanc
> -Original Message-
> From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] 
> Sent: Friday, 5 March 2004 5:13 AM
> To: Silky Manwani
> Cc: [EMAIL PROTECTED]
> Subject: Re: Perl script to switch user to root.
> 
> Silky Manwani wrote:
> > Hello,
> > 
> > I want to write a perl script to switch user (to root). The 
> problem is 
> > that since it asks for the password, I am not sure how I 
> would pass it 
> > thru the script. I know I can run the "su root" with the 
> system command 
> > in perl, but how do I take care of passing the password.
> > 
> > Thanks.
> > 
> > 
> 
> 
> http://expect.nist.gov/
> 
> spawn /bin/su $userid "-c /usr/bin/passwd"
> 
> However no matter HOW you decide to do it the solution will not be 
> secure; you might want to see if suid scripts are secure on 
> your system 
> and take that route...

SUID scripts are not secure.
Modern OS's disable them.

(Windows is so insecure you don't need to be suid.. but that's another
 forum)

Locate one of the various 'sudo' style utilities and use it to
launch a script or command as root.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Recent pcap discussions

2004-03-05 Thread WC -Sx- Jones
I recently (again) run across this issue with a somewhat old TCPDUMP 
security issue; I figured it might be relevant here -- especially 
considering all the recent pcap and tcp/ip sniffing discussions:

Issue -

tcpdump -i lo0 -n udp and dst port 1701 & 
perl -e 'print "\xff\x02"' | nc -u localhost 1701
The above is a local security hack which could give non-priledged users 
root access.

To Avoid/Fix -

Please make sure you are using correctly patched/updated pcap and 
tcpdump libraries and code.

Just a small fyi;
-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Handling blank lines in while() construct

2004-03-05 Thread WC -Sx- Jones
David le Blanc wrote:

As far as this:

"$yellow")}
elsif ( $conf_line[1] =~ "blue" ) {push(@color_array,
Why not just:

sub push_Colors() {
my $color = shift;
push(@color_array,$color)
}
Called like:

push_Colors($conf_line[1]);


I thought he was pushing '$yellow' when he found 'yellow'.  

Your code would just push the word found (ie, literal 'yellow')

I think...

One of us is confused ;-)
Yep.  =)  I am prolly...

Bottomline is what is $yellow if not yellow?

I only made my suggestion to have the OP to see if they might like to 
re-evaluate what they originally programmed.

-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: links in POD

2004-03-05 Thread Freimuth,Robert
> > I'm trying to use POD to document my application.  I have about 5
> > different doc files, and I'd like to create links between them when
> > they are translated from POD to HTML.  For example, in doc 
> file 1 I'd
> > like to say '...using the foo function, as described in  > 2>...', and have the link open doc file 2.  I read the POD
> > documentation, specifically the section on creating links with
> > L<...>, but the only examples I can find link to man pages.  I
> > couldn't find anything that described creating absolute or relative
> > links to other files. 
> > 
> > I tried a couple of different things, just to see what happened.  I
> > specified the base name only, the complete filename, and the full
> > path for DOC FILE 2 within the L<...> construct, but I keep getting
> > the following error: 
> > 
> > C:\perl\app1\docs\pod\pod2html_txt.pl: app1_example.pod: cannot
> > resolve L in paragraph 4. at
> > C:/ActivePerl/lib/Pod/Html.pm line 1562.
> > 
> > In this case, app1_example.pod contains
> > 'L' and the License.html file is
> > in the same directory as app1_example.pod.  (The pod2html_txt.pl
> > program simply calls pod2html for me.)
> 
> You need to add --htmlroot=. and --podpath=. to your pod2html call.

Do I also need --htmldir?  I would like the html output file placed in a
different directory.  (see below)

> If the file you want to link to is License.pod, then create 
> your link as
> L

Thanks - that works.

> If you need to link to an external html file that isn't 
> derived from a .pod
> file, you have two choices:
> 
>Absolute link:
> 
>   L
> 
>Relative link:
> 
>   =for html Text
> 

Can the relative link contain path info (such as ..\..\file.html)?  (see
below)

I'll try to clarify what I'm trying to do.  I have two directories:
~\docs\pod and ~\docs\html.  I'd like to convert the pod files in ~\docs\pod
to html files in ~\docs\html, such that the links in ~\docs\html\file1.html
point to ~\docs\html\file2.html.  I would prefer to use relative links, but
the nice example given above seems to require hard-coding the html for each
link.  I assume from this that pod2html cannot create relative links.

So in summary, I want to call pod2html and say "here's a pod file that
contains links to another pod file - translate this into html, put the output
file in ..\html\, and make the links point to files within that same
directory".

I've made some progress on this, but it's still not working quite right.  In
retrospect, I should have posted the code for my pod2html call, since that
appears to be the biggest source of the problem (sorry!).  I didn't (and
still don't) understand the pod2html docs completely, so I'm trying to work
through them by experimenting.  My code looks like this:

use strict;
use warnings;

use Pod::Html;

my $file_base = 'testfile1';

my $pod_infile   = $file_base . '.pod';
my $html_outfile = $file_base . '.html';

my $podroot  = 'C:\perlcode\myapp\docs';
my $htmlroot = 'C:\perlcode\myapp\docs';
my $htmldir  = 'C:\perlcode\myapp\docs\html';
my $htmlpathfile = $htmldir . '\\' . $html_outfile;

pod2html( "--infile=$pod_infile",
  "--outfile=$htmlpathfile",
  "--header",
  "--htmlroot=$htmlroot",
  "--podroot=$podroot",
  "--podpath=pod"
 );

and the link in testfile1.pod is L.

When I run this, I get testfile1.html in ~\docs\html, but the link within it
is to ~\docs\pod\testfile2.html.  The only way I could get testfile1.html to
show up in ~\docs\html was to specify the complete path and filename in
--outfile.  I tried setting --htmldir as shown above and leaving
--outfile=$html_outfile (no path), but then testfile1.html ends up in
~\docs\pod.

If I change --podpath=pod to --podpath=html (in an attempt to correct the
link), I get the 'cannot resolve L' error again.

Any additional assistance is much appreciated.  I really appreciate you and
the other gurus on this list that take the time to help out us novices.

Thanks again,

Bob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Checking filenames? [:: ?Kinda Solved? ::]

2004-03-05 Thread wolf blaum
On Friday 05 March 2004 02:03, Sumit Kaur generously enriched virtual reallity 
by making up this one:

> Hi,

Hi,

> I have to write my first Perl script . This scripts Searches for rare =
> codons in nucleotide sequence . The nucleotide sequence is entered by =
> the user in the format "ATTGCAA.." and then the program breaks this =
> sequence in the groups of three alphabets like ATT,GCA...so no.=20
>
> Please suggest .

I first of all suggest you use new subject line...
Then: read Learning perl by Randal Schwartz and Tom Phoenix and tell us if you 
are learning perl as a first language or allready know about control 
structures, filehandles and regluar expressions

Then: what do you mean by "rare" - do you want the program to figure out, what 
the least frequent codons are and list/count/whatever them or do you have a 
prior definition of rare. Further (given your example above):

ATTGCAA
ATT
   TTG
  TGC

are all these codons or do you assume your user supplied sequence starts 
somewhere you know and goes on in triplets from there on? (That is, does the 
user supply only exons starting with the start tripplet?)

Once you get past the first steps: look at the bioperl modules at cpan and at 
www.Bioperl.org

Enjoy  -Wolf



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Perl script to switch user to root.

2004-03-05 Thread WC -Sx- Jones
David le Blanc wrote:

SUID scripts are not secure.
Modern OS's disable them.
True; but it is difficult to ask for a firecracker when all you can use 
is a stick of dynamite...

Besides, I forget, was the OP on MacOS?

IMHO it is best to see if root MUST be the only recourse. Maybe 
alternatives were not fully explored...

-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: links in POD

2004-03-05 Thread WC -Sx- Jones
Freimuth,Robert wrote:
...
< snip >
...
You know, this is all sort of like using

DocSet 0.16 from CPAN
http://search.cpan.org/~stas/DocSet-0.16/
Have you seen it?
-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Checking filenames? [:: ?Kinda Solved? ::]

2004-03-05 Thread WC -Sx- Jones
John W. Krahn wrote:
Wc -Sx- Jones wrote:

Charles K. Clarkson wrote:


   Make 'Indians' an array.

my( $onelittle,
   $twolittle,
   $threelittle, ) = ('Indians') x 3;
Create it with a HereDoc  =)


Oh, how do you do that?


I guess I made you all wait long enough...

# WARNING - not strict or -w safe...

my ($line1,
$line2,
$line3,
$line4,
$line5) = (<<"END_OF_HERE_DOC" =~ m/^\s*(.+)/gm);
One little
 two little
  3 little Indians...
END_OF_HERE_DOC
print "1: $line1, 2: $line2, 3: $line3, $line4, $line5";

(Yes, I read the Perl Cookbook. :)
-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Disable Screensaver with Keyboard input

2004-03-05 Thread Stefan Lubitz
Hi there,
 
I have the problem that after 10 minutes the Screensaver of my PC is getting
activated. I am not able to change it, because it is a W2k Domain policy.
Now I thought, that I could write a small Perl Script, which is turning on
and off the Scrolllock Key, means "simulating" a Keyboard input.
Does anyone know how to do this with Perl? Or is there another solution?
 
Best regards ant thanks for your answers,
Stefan



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Disable Screensaver with Keyboard input

2004-03-05 Thread Beau E. Cox
On Friday 05 March 2004 02:16 am, Stefan Lubitz wrote:
> Hi there,
>
> I have the problem that after 10 minutes the Screensaver of my PC is
> getting activated. I am not able to change it, because it is a W2k Domain
> policy. Now I thought, that I could write a small Perl Script, which is
> turning on and off the Scrolllock Key, means "simulating" a Keyboard input.
> Does anyone know how to do this with Perl? Or is there another solution?
>
> Best regards ant thanks for your answers,
> Stefan

Stefan -

It's been a while since I used Windows (I've moved on to
Linux - a real operating systen ;) ), but I think you
can do something with W32::Console. Have a look at the
docs on CPAN (or is it a domain policy that you cannot install
CPAN modules?).

Aloha => Beau;


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




WG: Disable Screensaver with Keyboard input

2004-03-05 Thread Stefan Lubitz
 Hi erveryone, hi Beau
first,thank you for the answer. I read the dokumentation for Win32::Console,
but I do not find a way to SET the capslock or scrolllock key. I only find a
way to read the status of the key's.
Maybe I do not understand the System how this is handeld. Could someone give
me maybe some hint.

Stefan

-Ursprüngliche Nachricht-
Von: Beau E. Cox [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 5. März 2004 13:29
An: [EMAIL PROTECTED]
Cc: Stefan Lubitz
Betreff: Re: Disable Screensaver with Keyboard input

On Friday 05 March 2004 02:16 am, Stefan Lubitz wrote:
> Hi there,
>
> I have the problem that after 10 minutes the Screensaver of my PC is 
> getting activated. I am not able to change it, because it is a W2k 
> Domain policy. Now I thought, that I could write a small Perl Script, 
> which is turning on and off the Scrolllock Key, means "simulating" a
Keyboard input.
> Does anyone know how to do this with Perl? Or is there another solution?
>
> Best regards ant thanks for your answers, Stefan

Stefan -

It's been a while since I used Windows (I've moved on to Linux - a real
operating systen ;) ), but I think you can do something with W32::Console.
Have a look at the docs on CPAN (or is it a domain policy that you cannot
install CPAN modules?).

Aloha => Beau;




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Handling blank lines in while() construct

2004-03-05 Thread Michael Weber
Hi, David, et. al.

I probably should have given a little more info on what I want this
program to do.  See below...

 "David le Blanc" <[EMAIL PROTECTED]>
03/05/04 03:26AM >>>
>> -Original Message-
>> From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] 
>> Sent: Friday, 5 March 2004 4:16 AM
>> To: Michael Weber
>> Cc: [EMAIL PROTECTED] 
>> Subject: Re: Handling blank lines in while() construct
>> 
>> As far as this:
>> 
>> "$yellow")}
>>  elsif ( $conf_line[1] =~ "blue" ) {push(@color_array,
>> 
>> Why not just:
>> 
>> sub push_Colors() {
>>  my $color = shift;
>>  push(@color_array,$color)
>> }
>> 
>> Called like:
>> 
>> push_Colors($conf_line[1]);
>
>
>I thought he was pushing '$yellow' when he found 'yellow'.  
>

Actually, the variable, along with all the other colors, is assigned
above the snippet of code like this...

my $yellow="\033[1;33m";

This is the terminal code to produce a yellow text output.

>Your code would just push the word found (ie, literal 'yellow')
>
>I think...<
>

What it creates is "${yellow}string${normal}" from "string".  See
below...

>>One of us is confused ;-)
>>
>
>> 
>> Unless of course your data input just has a color embedded:
>> sometextcolorredorbluebutwhoknows...

Pretty much accurate.  The text stream looks like this:

[Snip from /var/log/maillog]
Feb 29 16:52:01 web-2 postfix/smtpd[32047]: 6AD1EBBEF: reject: RCPT
from unknown [12.127.237.226]: 554 : Helo command
rejected: Don't spoof my hostname; from=<[EMAIL PROTECTED]>
to=<[EMAIL PROTECTED]> proto=SMTP helo=

If I were watching my maillog file stream past, I would want to see
quickly if any messages are getting rejected.  So I flag the word
"reject" in the line above to be red.  So I can easily see why the
message was rejected, I would shade the string "Don't spoof my hostname"
to be ltblue.

To do this, I create a lookup table (@color_array) with all the color
names that maps the correct terminal codes ($color) to turn on and turn
off the colorization.  I have a second array (@trigger_array) that holds
the texts to look for.  The indices between the two map which colors to
prepend the the matching text.  Then I do a substring replace in the
stream, in realtime,looking for "reject" (as found in @trigger_array)
and replace it with "reject" and send that
line to the terminal.  This array is created dynamically by the code
snip I started this thread with from a config file when the program
starts.  Once the arrays are created, I never use this code again so
speed isn't criical.

Perl is fast enough that I can only see a split second delay using the
filter.  Syslog takes longer than that to get the text into the file.

I posted the code to the list yesterday, but it hasn't shown up.  I
guess the list doesn't like attachments.  I will re-post it in-line
later.  There are still a few tweaks that people have come up with that
I want to include.

Thanx, all for your help!

-Michael

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Disable Screensaver with Keyboard input

2004-03-05 Thread Tim Johnson

Check out the Win32::SetupSup module.  It will allow you to send
keystrokes to the console.

 

-Original Message-
From: Stefan Lubitz [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 05, 2004 4:16 AM
To: [EMAIL PROTECTED]
Subject: Disable Screensaver with Keyboard input

Hi there,
 


Now I thought, that I could write a small Perl Script, which is turning
on and off the Scrolllock Key, means "simulating" a Keyboard input.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Cache::Filecache Question

2004-03-05 Thread Michael C. Davis
At 09:58 PM 3/4/04 -0800, R. Joseph Newton wrote:
>If you are using the Cache::FileCache package, the package-level functions
>exorted by the package are available to you.  Any object blessed into this
>package will have access to all methods defined in the package.  Remember
that
>anmespace is a general term which can be applied in different contexts.  I
get
>the impression that you are mixing the Perl namespace paradigm with the
>namespace paradigm of some completely different system.
>
>Can you be more specific about your issue?


Thank you for your reply.  I must apologize for not being more clear.
Cache::FileCache allows one to specify a namespace within which cached
objects are preserved, like so:

  my $cache = new Cache::FileCache( { 'namespace' => 'MyNamespace',
  'default_expires_in' => 600 } );

... or, at least, that's my assumption.  I haven't written any code with it
yet, so I guess the namespace could be referring to a Perl namespace.
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Perl IDE

2004-03-05 Thread Alexander Douglas
Hello

I am new to perl and hence needs some help..

1) Is there a good IDE to build perl forms for web.
2) If i have to connect perl to firebird database just the DBI module from
perl is enough or do i need any more drivers, The OS is solaris and linux
with wiindows clients for developement.

Please advice
Thanks in Advance
Mohammed



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: problem in array accessing

2004-03-05 Thread zsdc
R. Joseph Newton wrote:

"N, Guruguhan (GEAE, Foreign National, EACOE)" wrote:

   @temp =  ;
Here is your immediate problem.  The line above puts the first line of the file 
into the first element of @temp.  If you must dump all your data into an array, then 
you will have to put the input operation into list context by enclosing it in 
parentheses:
 @temp = ();
The assignment to array already provides the list context, so:

  @temp = ;

is equivalent to

  @temp = ();

reading whole INPUT, and not:

  @temp = scalar ;

which would read one line of INPUT and store it in the first element of 
one-element @temp array.

--
ZSDC
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Nothing executes after system.

2004-03-05 Thread Silky Manwani
Hello,

@args = ("/usr/bin/su","sam");
system(@args);
print "hello";
Any idea why print never gets executed? So, the switch user takes place 
but nothing gets executed after that..

Thanks.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: Nothing executes after system.

2004-03-05 Thread Hanson, Rob
> Any idea why print never gets executed?

The su is probably waiting for you to enter in a password.

...And this probably doesn't do what you think anyway.  Even though you su,
it doesn't change who the current script is running under.  Your program (as
written) will spawn a new process, execute su, then close that process.

Hope that helps.

Rob

-Original Message-
From: Silky Manwani [mailto:[EMAIL PROTECTED]
Sent: Friday, March 05, 2004 1:16 PM
To: [EMAIL PROTECTED]
Subject: Nothing executes after system.


Hello,

@args = ("/usr/bin/su","sam");
system(@args);
print "hello";

Any idea why print never gets executed? So, the switch user takes place 
but nothing gets executed after that..

Thanks.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Nothing executes after system.

2004-03-05 Thread Silky Manwani
It doesn't wait for the password. I can see that it switches the user 
coz the prompt changes. But as you said , yes, since another process 
gets spawned and su gets executed.

Is there another way os saying "su" using perl?

Thanks.

On Mar 5, 2004, at 10:26 AM, Hanson, Rob wrote:

Any idea why print never gets executed?
The su is probably waiting for you to enter in a password.

...And this probably doesn't do what you think anyway.  Even though 
you su,
it doesn't change who the current script is running under.  Your 
program (as
written) will spawn a new process, execute su, then close that process.

Hope that helps.

Rob

-Original Message-
From: Silky Manwani [mailto:[EMAIL PROTECTED]
Sent: Friday, March 05, 2004 1:16 PM
To: [EMAIL PROTECTED]
Subject: Nothing executes after system.
Hello,

@args = ("/usr/bin/su","sam");
system(@args);
print "hello";
Any idea why print never gets executed? So, the switch user takes place
but nothing gets executed after that..
Thanks.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: installing perl 5.8

2004-03-05 Thread david
Nilay Puri wrote:

> Hi ,
> 
> I have perl 5.005_03 on Sun SOlaris installed at /usr/bin and
> /usr/local/bin.
> 
> I need to install perl.
> 
> I want to know
> 1. From where to get the the perl 5.8
>

you can get both the source and binary of Perl 5.8.x from:

http://www.cpan.org

>
> 2. Which is the best place to install on the sun solaris.
>

doesn't matter. as long as you communicate back to the users where the new 
Perl binary is installed, you are free to install it anywhere you want 
(other than the old location where a old copy of Perl is ready installed, 
reason being you don't want to over write the old version). when you 
install Perl, you will be given a chance to specify a prefix where Perl 
will be installed, you can specify it there.

>
> 3. Are there any precautions to be taken whicle installing. ( since
> i alread have perl )
>

you should take precautions not to over write the older version of Perl. if 
you already have application and scripts that runs fine with the older 
version of Perl, they should continue to run without any modification. once 
the newer version of Perl is installed, you need to communicate that back 
to the developers so any new development will be using Perl 5.8 instead of 
the older one.

>
> 4. Do i have to install all the required(my project specific) perl
> module which i had earlier installed at /usr/local/bin/,  again after
> installing perl 5.8
>

Perl 5.8.x is NOT binary compatible with older version of Perl. because of 
that, it's important that you do NOT install the newer version of Perl over 
the older ones or your application or scripts will start to fail all the 
sudden. binary compatible means modules written in C/XS will most likely 
fail to work and you must recompile and reinstall them. modules that are 
pure Perl should continue to work.

david
-- 
s$s*$+/http://learn.perl.org/> 




Re: Perl IDE

2004-03-05 Thread wolf blaum
On Friday 05 March 2004 18:26, Alexander Douglas generously enriched virtual 
reallity by making up this one:

> Hello
Hello

> I am new to perl and hence needs some help..
>
> 1) Is there a good IDE to build perl forms for web.

Emacs, VIM :-)
Use the CGI module.

> 2) If i have to connect perl to firebird database just the DBI module from
> perl is enough or do i need any more drivers, The OS is solaris and linux
> with wiindows clients for developement.


DBI implements the API to Database programing in perl and is database 
independet.
For each seperate database you want to work on using DBI you further need the 
appropriate DB driver module:
DBD::InterBase for Interbase and Firbird RDBMS available via CPAN.

Enjoy - Wolf


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Nothing executes after system.

2004-03-05 Thread Hanson, Rob
> Is there another way os saying "su" using perl?

You might be able to do it with the POSIX module, and the setuid() call.
But I can't say that I have tried it, so I am only guessing.

See:
 man setuid
 http://search.cpan.org/~lbrocard/perl5.005_04/ext/POSIX/POSIX.pod

Rob

-Original Message-
From: Silky Manwani [mailto:[EMAIL PROTECTED]
Sent: Friday, March 05, 2004 1:30 PM
Cc: [EMAIL PROTECTED]
Subject: Re: Nothing executes after system.


It doesn't wait for the password. I can see that it switches the user 
coz the prompt changes. But as you said , yes, since another process 
gets spawned and su gets executed.

Is there another way os saying "su" using perl?

Thanks.

On Mar 5, 2004, at 10:26 AM, Hanson, Rob wrote:

>> Any idea why print never gets executed?
>
> The su is probably waiting for you to enter in a password.
>
> ...And this probably doesn't do what you think anyway.  Even though 
> you su,
> it doesn't change who the current script is running under.  Your 
> program (as
> written) will spawn a new process, execute su, then close that process.
>
> Hope that helps.
>
> Rob
>
> -Original Message-
> From: Silky Manwani [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 05, 2004 1:16 PM
> To: [EMAIL PROTECTED]
> Subject: Nothing executes after system.
>
>
> Hello,
>
> @args = ("/usr/bin/su","sam");
> system(@args);
> print "hello";
>
> Any idea why print never gets executed? So, the switch user takes place
> but nothing gets executed after that..
>
> Thanks.
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Perl IDE

2004-03-05 Thread wolf blaum
On Friday 05 March 2004 18:26, Alexander Douglas generously enriched virtual 
reallity by making up this one:

> Hello
Hello

> I am new to perl and hence needs some help..
>
> 1) Is there a good IDE to build perl forms for web.

Emacs, VIM :-)
Use the CGI module.

> 2) If i have to connect perl to firebird database just the DBI module from
> perl is enough or do i need any more drivers, The OS is solaris and linux
> with wiindows clients for developement.


DBI implements the API to Database programming in perl and is database 
independet.
For each seperate database you want to work on using DBI you further need the 
appropriat DB driver module:
DBD::InterBase for Interbase and Firbird RDBMS available via CPAN.

Enjoy - Wolf




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Nucleotide Sequence

2004-03-05 Thread Sumit Kaur
 Hi,
 
 I have to write my first Perl script . This scripts Searches for rare codons in 
nucleotide sequence . The nucleotide sequence is entered by the user in the format 
"ATTGCAATT.." and then the scripts breaks this sequence in the groups of three 
alphabets like ATT,GCA,ATT...so no.and then I have a list of the combinations and 
their probabilites like ATT (34.4) . I compare the breaked sequence against this list 
and print out the total that is the sum of all the similar combis
 Please suggest .

Thanks

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Code Socket Port... Read In and sent out to perl script

2004-03-05 Thread Paul Kraus
I hate to ask for code but I am kind of in a crunch to finish a project. 

I have the network programming with perl but it's just too much to read by
tomorrow night :)

I need a daemon listening on a port. I need a client side script that just
takes piped input in and then dumps it out to a file on the other server.

I need more then that but the rest I can handle in the allocated time.

Example
Files sendtextfile (arguments) server port

cat mytextfile.txt | sendtextfile xxx.xxx.xxx.xxx 12000

Then on the server this file would just be dumped to stdout or disk.
I will be doing a lot with it actually but this framework will get me where
I need to be to finish up this project. 

The server could be getting hit with more then one file at a time.

If you do end up helping me out I appreciate, deeply!

I am guessing this is easy if it's really involved then I apologize now for
even asking :)

 Paul Kraus
 ---
 PEL Supply Company
 Network Administrator
 ---
 800 321-1264 Toll Free
 216 267-5775 Voice
 216 267-6176 Fax
 www.pelsupply.com
 ---



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Nucleotide Sequence

2004-03-05 Thread km
Hi,

can u pls  be a bit clear abt the  question.
are u considering all 6 frames while generating combinations ? 
u'll have to be comfortable with basics of  Perl.

As far as i have understood ur question i have made  a program.
HTH,
regards,
KM

## program  #
#!/usr/bin/perl -w   # change it to ur perl path 
use strict;
my $seq = "ATGCCGCTGGTG"; # sequence 
my $hops = int(len($seq)/3);
my %prob = ("ATT"=>0.1); # triplets to probabilities mapped
my $sum = 0;

while($k <= $hops)
{
my $triplet = substr($seq,$k,3);
$sum += $prob{$triplet};
$k+=3;
}
print $sum;  # total 
## program ##

-
In-Reply-To: <[EMAIL PROTECTED]>

On Fri, Mar 05, 2004 at 12:11:25PM -0800, Sumit Kaur wrote:
>  Hi,
>  
>  I have to write my first Perl script . This scripts Searches for rare codons in 
> nucleotide sequence . The nucleotide sequence is entered by the user in the format 
> "ATTGCAATT.." and then the scripts breaks this sequence in the groups of three 
> alphabets like ATT,GCA,ATT...so no.and then I have a list of the combinations and 
> their probabilites like ATT (34.4) . I compare the breaked sequence against this 
> list and print out the total that is the sum of all the similar combis
>  Please suggest .
> 
> Thanks
> 





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Nucleotide Sequence

2004-03-05 Thread Jayakumar Rajagopal
I think he asked something like this.. But I am not clear with his question..


#!/usr/bin/perl -w   # change it to ur perl path 
use strict;
my $seq = "ATGCCGCTGGTG"; # sequence 
my $hops = int(len($seq)/3);
my %prob = ("ATT"=>0.1); # triplets to probabilities mapped
my $sum = 0;

while($k <= $hops)
{
my $triplet = substr($seq,$k,3);
$prob{$triplet}++;
$k+=3;
}
while ( ($triplet,$val) = each %prob ) {
print "\n $triplet occured $val times \n"; 
}

-Original Message-
From: km [mailto:[EMAIL PROTECTED]
Sent: Friday, March 05, 2004 4:10 PM
To: Sumit Kaur
Cc: [EMAIL PROTECTED]
Subject: Re: Nucleotide Sequence


Hi,

can u pls  be a bit clear abt the  question.
are u considering all 6 frames while generating combinations ? 
u'll have to be comfortable with basics of  Perl.

As far as i have understood ur question i have made  a program.
HTH,
regards,
KM

## program  #
#!/usr/bin/perl -w   # change it to ur perl path 
use strict;
my $seq = "ATGCCGCTGGTG"; # sequence 
my $hops = int(len($seq)/3);
my %prob = ("ATT"=>0.1); # triplets to probabilities mapped
my $sum = 0;

while($k <= $hops)
{
my $triplet = substr($seq,$k,3);
$sum += $prob{$triplet};
$k+=3;
}
print $sum;  # total 
## program ##

-
In-Reply-To: <[EMAIL PROTECTED]>

On Fri, Mar 05, 2004 at 12:11:25PM -0800, Sumit Kaur wrote:
>  Hi,
>  
>  I have to write my first Perl script . This scripts Searches for rare codons in 
> nucleotide sequence . The nucleotide sequence is entered by the user in the format 
> "ATTGCAATT.." and then the scripts breaks this sequence in the groups of three 
> alphabets like ATT,GCA,ATT...so no.and then I have a list of the combinations and 
> their probabilites like ATT (34.4) . I compare the breaked sequence against this 
> list and print out the total that is the sum of all the similar combis
>  Please suggest .
> 
> Thanks
> 





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Nucleotide Sequence

2004-03-05 Thread km
Hi,
Well thats fine .
KM
-- 
On Fri, Mar 05, 2004 at 01:29:36PM -0800, Sumit Kaur wrote:
> Hey ,
> 
> I am not considering all the frames . Just the first combination. I am using the 
> book Learning perl for my basics. 
> 
> Thanks and Best Regards,
> 
> Sumit
> 
> -Original Message-
> From: km [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 05, 2004 1:10 PM
> To: Sumit Kaur
> Cc: [EMAIL PROTECTED]
> Subject: Re: Nucleotide Sequence
> 
> 
> Hi,
> 
> can u pls  be a bit clear abt the  question.
> are u considering all 6 frames while generating combinations ? 
> u'll have to be comfortable with basics of  Perl.
> 
> As far as i have understood ur question i have made  a program.
> HTH,
> regards,
> KM
> 
> ## program  #
> #!/usr/bin/perl -w   # change it to ur perl path 
> use strict;
> my $seq = "ATGCCGCTGGTG"; # sequence 
> my $hops = int(len($seq)/3);
> my %prob = ("ATT"=>0.1); # triplets to probabilities mapped
> my $sum = 0;
> 
> while($k <= $hops)
> {
> my $triplet = substr($seq,$k,3);
> $sum += $prob{$triplet};
> $k+=3;
> }
> print $sum;  # total 
> ## program ##
> 
> -
> In-Reply-To: <[EMAIL PROTECTED]>
> 
> On Fri, Mar 05, 2004 at 12:11:25PM -0800, Sumit Kaur wrote:
> >  Hi,
> >  
> >  I have to write my first Perl script . This scripts Searches for rare codons in 
> > nucleotide sequence . The nucleotide sequence is entered by the user in the format 
> > "ATTGCAATT.." and then the scripts breaks this sequence in the groups of three 
> > alphabets like ATT,GCA,ATT...so no.and then I have a list of the combinations and 
> > their probabilites like ATT (34.4) . I compare the breaked sequence against this 
> > list and print out the total that is the sum of all the similar combis
> >  Please suggest .
> > 
> > Thanks
> > 
> 
> 
> 
> 
> 

-- 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Code Socket Port... Read In and sent out to perl script

2004-03-05 Thread Bob Showalter
Paul Kraus wrote:
> I hate to ask for code but I am kind of in a crunch to finish a
> project. 

See below.

> 
> I have the network programming with perl but it's just too much to
> read by tomorrow night :)

Buy the Perl Cookbook. It has good examples for this kind of thing.

> 
> I need a daemon listening on a port. I need a client side script that
> just takes piped input in and then dumps it out to a file on the
> other server. 
> 
> I need more then that but the rest I can handle in the allocated time.
> 
> Example
> Files sendtextfile (arguments) server port
> 
> cat mytextfile.txt | sendtextfile xxx.xxx.xxx.xxx 12000

With this, the server won't know what to name the file, so I've just used an
incrementing number. You could extend the protocol to pass the filename.

(why not use FTP or similar?)

> 
> Then on the server this file would just be dumped to stdout or disk.
> I will be doing a lot with it actually but this framework will get me
> where I need to be to finish up this project.
> 
> The server could be getting hit with more then one file at a time.

I'm forking a process to handle each client.

> 
> If you do end up helping me out I appreciate, deeply!
> 
> I am guessing this is easy if it's really involved then I apologize
> now for even asking :)

OK, you owe me a beer :~) Note that this has zilch security or anything to
prevent DoS type attacks, so caveat emptor...

server.pl
-
  #!/usr/bin/perl

  use strict;
  use IO::Socket::INET;

  my $n = 0;

  my $sock = IO::Socket::INET->new(
  LocalPort => 12000,
  Proto => 'tcp',
  Listen => 5)
  or die "Couldn't create listen socket: $!";

  warn "Waiting for connections\n";
  while (my $client = $sock->accept) {
  $n++;
  defined(my $pid = fork) or die "Couldn't fork: $!";
  next if $pid;

  my $host = $client->peerhost;
  my $file = "file.$n";
  warn "Received connection from $host, writing to $file\n";
  open F, ">$file";
  print F while <$client>;
  close F;
  warn "Connection from $host closed\n";
  exit;
  }

client.pl
-
  #!/usr/bin/perl

  use strict;
  use IO::Socket::INET;

  my $n = 0;

  @ARGV or die "usage: $0 host [port]\n";
  my $host = shift;
  my $port = shift || 12000;

  my $sock = IO::Socket::INET->new(
  PeerAddr => $host,
  PeerPort => $port,
  Proto => 'tcp')
  or die "Couldn't connect to $host:$port: $!";

  print $sock $_ while <>;

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Code Socket Port... Read In and sent out to perl script

2004-03-05 Thread Bob Showalter
Bob Showalter wrote:
> ...
>   warn "Received connection from $host, writing to $file\n";
>   open F, ">$file";

Stick some error checking in there :~)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Code Socket Port... Read In and sent out to perl script

2004-03-05 Thread James Edward Gray II
On Mar 5, 2004, at 2:21 PM, Paul Kraus wrote:

I hate to ask for code but I am kind of in a crunch to finish a 
project.

I have the network programming with perl but it's just too much to 
read by
tomorrow night :)
Here's an example server, pretty much right out of the Perl Cookbook:

#!/usr/bin/perl

use strict;
use warnings;
use IO::Socket::INET;
use POSIX qw(:sys_wait_h);
my $listener = IO::Socket::INET->new( LocalPort  => 61676,
  Listen
=> SOMAXCONN,
  Reuse 
=> 1 );
# clean up dead processed
sub REAPER {
1 until (-1 == waitpid(-1, WNOHANG));
$SIG{CHLD} = \&REAPER;
}
$SIG{CHLD} = \&REAPER;
while (my $socket = $listener->accept) {
next unless $socket;
next if my $pid = fork;
die "Fork error:  $!" unless defined $pid;

# in child here
$listener->close();

# do work here, like:
while (<$socket>) { print; }  # or whatever

exit;
}
continue {
$socket->close();
}
__END__

Hope that gets you going.

James

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Code Socket Port... Read In and sent out to perl script

2004-03-05 Thread david
Paul Kraus wrote:
> 
> I need a daemon listening on a port. I need a client side script that just
> takes piped input in and then dumps it out to a file on the other server.
> 
> I need more then that but the rest I can handle in the allocated time.
> 
> Example
> Files sendtextfile (arguments) server port
> 
> cat mytextfile.txt | sendtextfile xxx.xxx.xxx.xxx 12000
> 

how does the server know how to name the file?

> Then on the server this file would just be dumped to stdout or disk.
> I will be doing a lot with it actually but this framework will get me
> where I need to be to finish up this project.
> 
> The server could be getting hit with more then one file at a time.

something similiar to the following should get you started:

#!/usr/bin/perl -w
use strict;

#--
#-- server.pl
#--
use IO::Socket::INET;

#--
#-- file will simply be named 1,2,3... etc
#--
my $file = 0;

my $server = IO::Socket::INET->new(Listen=> 5,
   LocalAddr => 'localhost',
   LocalPort => 5050,
   Proto => 'tcp') || die $!;

$SIG{CHLD} = 'IGNORE';

while(my $client = $server->accept){

$file++;

next if fork;

open(OUT,">$file") || exit;

select OUT;

print while(sysread($client,$_,1024));

close(OUT);
close($client);

exit;
}

__END__

#!/usr/bin/perl -w
use strict;

#--
#-- client.pl
#--
use IO::Socket::INET;

my $server = IO::Socket::INET->new(PeerAddr  => 'localhost',
PeerPort => 5050,
Proto=> 'tcp') || die $!;

while(<>){
print $server $_;
}

close($server);

__END__

[panda]# ls
file.1 file.2 file.3

[panda]# perl server.pl &
[panda]# perl client.pl file.1
[panda]# perl client.pl file.2
[panda]# perl client.pl file.3

[panda]# ls
1 2 3 file.1 file.2 file.3

notice the file 1, 2 and 3 are created (by the server) from file.1, file.2 
and file.3 respectively. i have omitted some error checking code for 
simplicity. you should add them when you are coding for production. you can 
easily modify the client to accept the following calling convention that 
you required:

cat file | client.p  

this is left as an exercise for you ;-)

david
-- 
s$s*$+/http://learn.perl.org/> 




RE: Code Socket Port... Read In and sent out to perl script

2004-03-05 Thread Paul Kraus
> OK, you owe me a beer :~) Note that this has zilch security or anything to
> prevent DoS type attacks, so caveat emptor...
Should I send the ups red label ;)

> 
> server.pl
> -
>   #!/usr/bin/perl
> 
>   use strict;
>   use IO::Socket::INET;
> 
>   my $n = 0;
> 
>   my $sock = IO::Socket::INET->new(
>   LocalPort => 12000,
>   Proto => 'tcp',
>   Listen => 5)
>   or die "Couldn't create listen socket: $!";
> 
>   warn "Waiting for connections\n";
>   while (my $client = $sock->accept) {
>   $n++;
>   defined(my $pid = fork) or die "Couldn't fork: $!";
>   next if $pid;
> 
>   my $host = $client->peerhost;
>   my $file = "file.$n";
>   warn "Received connection from $host, writing to $file\n";
>   open F, ">$file";
>   print F while <$client>;
>   close F;
>   warn "Connection from $host closed\n";
>   exit;
>   }
> 
> client.pl
> -
>   #!/usr/bin/perl
> 
>   use strict;
>   use IO::Socket::INET;
> 
>   my $n = 0;
> 
>   @ARGV or die "usage: $0 host [port]\n";
>   my $host = shift;
>   my $port = shift || 12000;
> 
>   my $sock = IO::Socket::INET->new(
>   PeerAddr => $host,
>   PeerPort => $port,
>   Proto => 'tcp')
>   or die "Couldn't connect to $host:$port: $!";
> 
>   print $sock $_ while <>;
Perfect Thanks!! As far as security and such I can build it back in later in
the week when I finish the network book. Thanks a bunch!!

Paul


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Code Socket Port... Read In and sent out to perl script

2004-03-05 Thread david
James Edward Gray II wrote:

> 
> # do work here, like:
> while (<$socket>) { print; }  # or whatever
> 

construct such as this should almost never be used in a network application. 
this will potentially hung your application when the client and the server 
use a different EOL sequence. when this happen, the client process won't 
return so when you fork again, the number of process will keep going up 
which will eventually fill up the process table and crash the machine.

david
-- 
s$s*$+/http://learn.perl.org/> 




Re: problem in array accessing

2004-03-05 Thread R. Joseph Newton
zsdc wrote:

> R. Joseph Newton wrote:
>
> > "N, Guruguhan (GEAE, Foreign National, EACOE)" wrote:
> >
> >>@temp =  ;
> >
> > Here is your immediate problem.  The line above puts the first line of the file 
> > into the first element of @temp.  If you must dump all your data into an array, 
> > then you will have to put the input operation into list context by enclosing it in 
> > parentheses:
> >  @temp = ();
>
> The assignment to array already provides the list context, so:
>
>@temp = ;
>
> is equivalent to
>
>@temp = ();
>
> reading whole INPUT, and not:
>
>@temp = scalar ;
>
> which would read one line of INPUT and store it in the first element of
> one-element @temp array.
>
> --
> ZSDC

Thanks for the catch.  I should have tested.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: problem in array accessing

2004-03-05 Thread R. Joseph Newton
"N, Guruguhan (GEAE, Foreign National, EACOE)" wrote:

> ...

>   if (-s $input_file_name ) {
> open(INPUT, $input_file_name) || die "Cannot open: \nReason: $!\n";
> @temp =  ;
> chomp @temp;
> $header = shift(@temp);
> $header =~ s/^\s+(.*)/$1/; #Remove the leading white spaces
> @col = split /\s+/, $header;
>
> foreach $i ( 0 .. $#temp ) {

...

> @data = split /\s+/, $data_line;

>$data[$i] = split /\s+/, $data_line;

This might be a source of the problem.  The control statement of the for loop sets the 
$i variable   Whatever got assigned to the @data array, this follows that assignment 
and assigns the number of elements in the split to $data[$i] .  [Hmmm, are you sure 
you are using warnings.  I tried this syntax and got:
$array[0] = split /\s+/, $line;
Use of implicit split to @_ is deprecated at - line 3.]

Without seeing the input file , in particular the last line of that file, it is hard 
to tell exactly what the gory outcome will be, but it is bound to not be pretty.


>
> }
>}
>
> @col = qw (RUN a1 a2 a3 weight sig1 sig2 sig3);
>
> @data=(

This must be the part that you highlighted in red, huh?

>
>   [qw( 1   0.20   0.20   0.20   0.76568575881.9
> 29289.3 -46592.6)],
>   ...

>  [qw( 5   0.359921   0.253987   0.359921   1.27199543861.3
> 19666.1 -24195.2)]
> );

Can you describe in less abstract terms what you are trying to accomplish.  What is 
the filter expression or function that you wish to use?  We can probably show you 
simpler ways to get the job done.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




hi!!

2004-03-05 Thread Shah, Aalok S
i have downloaded cygwin and perl 5.0 comes along with it.
How can i access perl from cygwin. My purpose is only to be able to write a script in 
perl and run it using cygwin. Can anyone help me with this..
 
regards
aalok
 


Re: Code Socket Port... Read In and sent out to perl script

2004-03-05 Thread James Edward Gray II
On Mar 5, 2004, at 4:55 PM, david wrote:

James Edward Gray II wrote:

# do work here, like:
while (<$socket>) { print; }  # or whatever
construct such as this should almost never be used in a network 
application.
this will potentially hung your application when the client and the 
server
use a different EOL sequence. when this happen, the client process 
won't
return so when you fork again, the number of process will keep going up
which will eventually fill up the process table and crash the machine.
 Obviously, that was the part NOT from the Cookbook.

For what it's worth, I did intend it just as an example, showing where 
to stick the IO code.  You're very right though and I should have 
clarified the dangers.

Thanks,

James

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Handling blank lines in while() construct

2004-03-05 Thread R. Joseph Newton
Michael Weber wrote:
...

> Pretty much accurate.  The text stream looks like this:
>
> [Snip from /var/log/maillog]
> Feb 29 16:52:01 web-2 postfix/smtpd[32047]: 6AD1EBBEF: reject: RCPT
> from unknown [12.127.237.226]: 554 : Helo command
> rejected: Don't spoof my hostname; from=<[EMAIL PROTECTED]>
> to=<[EMAIL PROTECTED]> proto=SMTP helo=
>
> If I were watching my maillog file stream past, I would want to see
> quickly if any messages are getting rejected.  So I flag the word
> "reject" in the line above to be red.  So I can easily see why the
> message was rejected, I would shade the string "Don't spoof my hostname"
> to be ltblue.

Sounds good so far.

[Except that, in the English language, there is no color "ltblue".  Do you mean
"light blue".  There is no point in descending into the Stygian swamp of 'codes'
until some existing interface demands it.  Since you are planning to use escape
sequences to actually feed the ANSI beast, you can use real words until you
convert to those escape sequences.]

>
>
> To do this, I create a lookup table (@color_array) with all the color
> names that maps the correct terminal codes ($color) to turn on and turn
> off the colorization.  I have a second array (@trigger_array) that holds
> the texts to look for.

This is where you get lost, by sttling too quickly on an inappropriate data
structure for the prupose.  The problem you are working with really calls for a
hash.

There are a couple ways you could use hashes here.  You could have one each for
colors, and one for texts:

my %ansi_escapes = (
  'blue'   => 34,
  'yellow'   => 33,
  ...
);

Since the "\033[1;" is probably constant, there is no reason to have it in the
data.  Things that are constant are more boilerplate than data.

my %error_colors = (
   'don\'t spoof my email' => 'cyan',
   
);

Then the escape sequence would be something along the lines of

my $escape_sequence = $ansi_escapes{$error_colors{$error_text}};

which, IMHO, would be much simpler.

Work with Perl hashes a bit, starting with some simple routines, and see how
they can make such relational jobs easy.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Cache::Filecache Question

2004-03-05 Thread R. Joseph Newton
"Michael C. Davis" wrote:

> At 09:58 PM 3/4/04 -0800, R. Joseph Newton wrote:
> >If you are using the Cache::FileCache package, the package-level functions
> >exorted by the package are available to you.  Any object blessed into this
> >package will have access to all methods defined in the package.  Remember
> that
> >anmespace is a general term which can be applied in different contexts.  I
> get
> >the impression that you are mixing the Perl namespace paradigm with the
> >namespace paradigm of some completely different system.
> >
> >Can you be more specific about your issue?
>
> Thank you for your reply.  I must apologize for not being more clear.
> Cache::FileCache allows one to specify a namespace within which cached
> objects are preserved, like so:
>
>   my $cache = new Cache::FileCache( { 'namespace' => 'MyNamespace',
>   'default_expires_in' => 600 } );
>
> ... or, at least, that's my assumption.  I haven't written any code with it
> yet, so I guess the namespace could be referring to a Perl namespace.

OK.  It lloks like you might benefit from thinking "hash name" in place of the
"namespaces" used in this package.  That or think of "package or lexical scope"
when considering Perl namespaces.  From what I see of the docs for Cache::Cache,
the conceptual base of the Cache::FileCache package, each anmespace is pretty
much equivalent to a hash--one that you can keep around indepentdent of your
programs execution.  I'm a bit fuzzy on the implementation details, but this
will do ffor separating them.

You might try some testing to see what works.  I probably will myself, but later
on.  At first blush, I would guess that a given namespace within a given cache
root will be available, to any Perl program using the module, by the names of
the cache root and hash/namespace.

The proof, though, isin the pudding.  Test.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: hi!!

2004-03-05 Thread WilliamGunther
>In a message dated 3/5/2004 6:11:53 PM Eastern Standard Time, 
>[EMAIL PROTECTED] writes:
>i have downloaded cygwin and perl 5.0 comes along with it.
>How can i access perl from cygwin. My purpose is only to be able to write a 
script in perl >and run it using cygwin. Can anyone help me with this..
>
>regards
>aalok

 
To be specific, I think perl 5.8.2 comes with cygwin :-) You access perl 
through cygwin like normal. Just run cygwin and run, 'perl /path/to/script.pl'. 
Or, if you put the path (#/usr/local/bin/perl on cygwin) you can run it as 
"/path/to/script.pl" (Remember though, if you're in the directory of the perl 
script, it isn't "script.pl" it is "./script.pl")

If you have already been coding Perl on a Windows system (just assumed your 
on a Windows system because you got cygwin) it doesn't take too much getting 
use to since you've had to learn Perl for Unix and then figure out to exceptions 
for Windows. cygwin is a relief after you've been fumbling with mc and 
ActiveState. 


-will
(the above message is double rot13 encoded for security reasons)

Most Useful Perl Modules
-strict
-warnings
-Devel::DProf
-Benchmark
-B::Deparse
-Data::Dumper
-Clone (a Godsend)
-Perl::Tidy
-Beautifier


Re: hi!!

2004-03-05 Thread Joel
This is off topic, but is cygwin just the ports of GNU software for windows,
or is it an actual command line interface that simulates linux?

Joel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Passing Data Between Servers

2004-03-05 Thread R. Joseph Newton
David le Blanc wrote:

> >

[snip--lots and lots of old stuff]

> > I vote for e-mail and less top-posting  =)
>

[snip--more old stuff not being replied to]

> Sorry about the top posting :")

It also helps keep focus if we remove material not related to the reply before
sending

Joseph



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: WG: Disable Screensaver with Keyboard input

2004-03-05 Thread R. Joseph Newton
Stefan Lubitz wrote:

> On Friday 05 March 2004 02:16 am, Stefan Lubitz wrote:
> > Hi there,
> >
> > I have the problem that after 10 minutes the Screensaver of my PC is
> > getting activated. I am not able to change it, because it is a W2k
> > Domain policy.

Should you perhaps ask the permission of the people who set the policy to be
excused.  It sounds to me like the computer belongs to them.

Joseph



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Passing array as First argument

2004-03-05 Thread R. Joseph Newton
"Halkyard, Jim" wrote:

Hi Jim,

It is better if you don't top-post.

> Hi Malik,
>
> If you pass a reference to the array as the first argument as below you can
> keep the array separate from the other arguments you are passing.
>
> @abc = qw(1 2 3);
> $x = 4;
> $y = 5;
>
> testsub([EMAIL PROTECTED], $x, $y);
>
> sub testsub($$$)
> {
> ($abc, $x, $y) = @_;
> print "Array @$abc\n";
> print "x $x\n";
> print "y $y\n";
> }

Thank you for using the clear scalar syntax in your prototype.


Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Passing array as First argument

2004-03-05 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote:

> In a message dated 3/3/2004 5:15:57 AM Eastern Standard Time,
> [EMAIL PROTECTED] writes:
> >testsub(@abc, $x, $y);
> >
> >sub testsub(@$$)
> >{
> >(@abc, $x, $y) = @_;
> >print "Array @abc\n";
> >print "x $x\n";
> >print "y $y\n";
> >}
>
> sub testsub ([EMAIL PROTECTED]);
> @abc = (1, 2, 3);
> $x = 3;
> $y = 4;
> testsub @abc, $x, $y; #parens now optional

Yes, but at a price in clarity.  What he is really passing in the above is a
scalar.  Especially for newcomers to the language, using an array symbol for the
argument makes it harder to see the difference, IMHO.


Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




HERE DOCUMENTS

2004-03-05 Thread WC -Sx- Jones
This is Part One of a Multipart posting - just to see if we can't keep 
things in the list archieves (Give the listbots something to do :)

(These are not really posted questions so much as they are things that 
beginners need to consider.)

"HERE" DOCUMENTS

* Here documents are used to embed lines of text in a Perl
  script, for printing or variable assignment.
  $foo = <
print <<_Html_;
various basic html can go here
sprinkled with Perl variables...
_Html_
NOTE that the ending portion of a heredoc must be in column zero -- I 
have noticed that having indented can cause issues at times...

* Variable interpolation is "on" by default.  You turn it off
  by making it single quoted.
  print <<'EOP0'
  interpolation is off:
  $foo $bar are not converted to data
  EOP0
Whether you use Double quotes, the variables are
interpolated into their corrisponding data:
  print <
# The following is somewhat dangerous; use with
# appropriate caution -
* Commands will be executed if the ending-string uses backticks.
  $sommand_results = <<`END_OF_COMMANDS`
  ls -al
  ps -aux
  END_OF_COMMANDS
Also, I previously posted how to cram single lines of text into an 
array; it is left upto the reader as an exercise to find that posting 
out there in Usenet land.

That's a small start to what I hope will become a long term thing :)

So, if you have a statement or neat easy to understand fact about HERE 
Documents, post it; keep this Perl Chain Posting going...

-Bill-
__Sx__
http://youve-reached-the.endoftheinternet.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: Cygwin: Port of unix commands or unix-like environment

2004-03-05 Thread David le Blanc
> -Original Message-
> From: Joel [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, 6 March 2004 1:29 PM
> To: perl
> Subject: Re: hi!!

I've changed your subject to be more appropriate to the question asked.

> 
> This is off topic, but is cygwin just the ports of GNU 
> software for windows,
> or is it an actual command line interface that simulates linux?

Since cygwin contains a port of perl which many of us use, its probably
not that far off topic :-)

The short answer is -  somewhere in between.

All the individual ported commands are windows EXE's, which can
be run stand-alone, or put into your path.  However they have
been tweaked work closely together and to make common assumptions.
One of these is to assume '/' is a directory of your hard drive
(such as c:\cygwin) and all drive letters are 'mounted' as
filesystems relative to /cygdrive/...


The BASH (bash?) shell has been ported, and once you launch
the shell, with appropriate variable settings and .profile
you are in an environment which feels very much like unix, and
probably a lot like linux.  Except for the fact you are in a 
windows COMMAND shell window, you couldn't tell the difference.

Then, to top it off, an Icon is placed onto your desktop which
launches /sbin/bash from the cygwin directory, and voila, you
are in a unix-like environment.

The port is sufficiently comprehensive, that with the GNOME modules
and networking modules, you could fool someone into thinking you
are running linux, complete with X-based login screen and 
gnome desktop.

Cheers.
David

> 
> Joel
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]