Re: Running Apache behind LinkSys Router

2003-12-18 Thread agftech lists
Indeed NOT a cgi related question.
There is probably more than just the router configuration. 
Now do this...
1. Check what IP address of the system your website is running on. If it
runs on all IPs designated to the system then nothing to worry on that
part.
2. Check port forwarding to the IP address and do make sure it is the
right port 80 or 8080 or whatever you use, should be configured
correctly on the router
3. IMPORTANTLY... check the DNS settings. If your site is accessed
internally as foobar.homelinux.com, is it configured on some external
DNS to point to the router's IP address that is forwarding it?

HTH
Aman

On Wed, 2003-12-17 at 17:57, Gohaku wrote:
 Hi everyone,
 I don't know if this is the right group to ask this but I have been 
 trying to access my website outside of my router but have been unable 
 to do so.
 
 I've tried Port Forwarding, changed some settings in http.conf.  My 
 site can be accessed at foobar.homelinux.com(for example) Locally.  But 
 if I try to access foobar.homelinux.com outside of the router, I can't 
 get a connection.
 
 Does anyone have a similar problem?
 
 -gohaku

__
Aman Raheja
AGF Technologies
http://www.agftech.com
__


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




OT: RE: RE: Running Apache behind LinkSys Router

2003-12-18 Thread jon


-Original Message-
From: Wiggins d Anconia [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 8:33 AM
To: 'Gohaku'; 'beginners-cgi'
Subject: OT: RE: Running Apache behind LinkSys Router



 Hi everyone,
 I don't know if this is the right group to ask this but I have been
 trying to access my website outside of my router but have been unable
 to do so.

 I've tried Port Forwarding, changed some settings in http.conf.  My
 site can be accessed at foobar.homelinux.com(for example) Locally.  But
 if I try to access foobar.homelinux.com outside of the router, I can't
 get a connection.

 Does anyone have a similar problem?

 -gohaku


I forget which which brand I had, but I had a similar problem. I eventually
found out that the particular brand would only forward 1 port to 1 ip
address. For more services, I had to create multiple IP addresses on my
server and create the forwards to different ports.

Also, check out http://www.dslreports.com. They have a lot of information on
specific routers, and if it's a general problem, there's probably already a
searchable thread about it.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Happy Birthday Perl

2003-12-18 Thread Swaminathan Gopal
There are many interesting data about Perl in perlhist. For example,

perldoc perlhist | perl -ne 'print if /larry.+\d+-\w+-\d+/i' | head -1
   Larry   1.000  1987-Dec-18
Happy Birthday Perl!

Btw, how can we do the above without using head -1? Any Perl way?



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: Happy Birthday Perl

2003-12-18 Thread Tassilo von Parseval
On Thu, Dec 18, 2003 at 03:08:05PM +0530 Swaminathan Gopal wrote:

 There are many interesting data about Perl in perlhist. For example,
 
 perldoc perlhist | perl -ne 'print if /larry.+\d+-\w+-\d+/i' | head -1
Larry   1.000  1987-Dec-18
 
 Happy Birthday Perl!
 
 Btw, how can we do the above without using head -1? Any Perl way?

Sure:

perldoc perlhist | perl -ne 'print and exit if /larry.+\d+-\w+-\d+/i'

Tassilo
-- 
$_=q#,}])!JAPH!qq(tsuJ[{@tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?=sub).+q#q!'qq.\t$.'!#+sexisexiixesixeseg;y~\n~~;eval


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: silly qn,.

2003-12-18 Thread Rob Dixon
Ajey wrote:

 how can i find which perl modules are installed on linux os?
 regds

Hi.

That's exactly what the ExtUtils::Installed was created for:

  use strict;
  use warnings;

  use ExtUtils::Installed;

  my $install = new ExtUtils::Installed;
  print map $_\n, $install-modules;

HTH,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: encrypting email address (to prevent spam)

2003-12-18 Thread Wiggins d Anconia


 Randal L. Schwartz [EMAIL PROTECTED] wrote:
 
   Sara == Sara  [EMAIL PROTECTED] writes:
  
  Sara I am looking for a way to encrypt  decrypt an email addy to
  Sara prevent spam while posting a message to discussion board.
  
  You also asked this, and I answered it, on the Perl Beginner's Mailing
  List at Yahoo.  It's a waste of resource to post a question like this
  in multiple places, and unethical to not disclose that it has been
  asked in such a manner.
 
 What's unethical about it?  What's wrong with posting it in multiple 
 places?!!  Not everyone on this list is a member of that list (and 
 vice-versa).  It is also very possible that someone on this list 
 doesn't know the answer she needs (or doesn't bother to respond).
 
 It is not as if she is cross-posting (same organization, multiple 
 lists).  She is using any resources she has available
 

Guessing, but I think he is meaning that if you post to one forum and
get a good answer and then decide to not bother with it then why should
a second forum have to provide an answer to a question (take the time of
people who are providing it for free (as in beer)) that has already been
asked and satisfactorily answered. Assuming the answer wasn't sufficient
then she should have stated as such, either in that other forum or in
this post so that we know what she has tried and what has failed.

http://danconia.org

--
Boycott the Sugar Bowl! You couldn't pay me to watch that game.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Cross platform default Printer

2003-12-18 Thread Shawn McKinley
Does anyone know of a way to find the default printer?

I have found there are some ways to do it on a single
platform, but I was wondering if there is a way to do
it without any OS proprietary code.

I have a script that will need to find the default
printer on Win(98 - XP), *nix, and Mac(OS 8 and 9).

TIA,
Shawn



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Cross platform default Printer

2003-12-18 Thread agftech lists
YOu may use Printer.pm 
I have only used with Linux but seems the Printer() print_command() take
the platform dependent arguments.
You can use control statements and take care of that.
There might be a better answer, I'll look forward to it.

HTH


On Thu, 2003-12-18 at 08:35, Shawn McKinley wrote:
 Does anyone know of a way to find the default printer?
 
 I have found there are some ways to do it on a single
 platform, but I was wondering if there is a way to do
 it without any OS proprietary code.
 
 I have a script that will need to find the default
 printer on Win(98 - XP), *nix, and Mac(OS 8 and 9).
 
 TIA,
 Shawn
 

__
Aman Raheja
AGF Technologies
http://www.agftech.com
__


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Align Text

2003-12-18 Thread James Edward Gray II
On Dec 18, 2003, at 12:03 AM, Bill Jastram wrote:

James:
I'm happy to help, but keep your replies on the list so we can all 
learn/help.

Can printf set the value in spaces of tab (\t)? I need to do three 
column
output with perl for mailing labels.
You bet:

perl -e 'printf %20s %20s %20s\n, James, Edward, Gray'
   James   Edward Gray
Three columns of 20 character width right there.  Does that answer your 
question?

James

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: silly qn,.

2003-12-18 Thread drieux
On Dec 18, 2003, at 3:08 AM, Rob Dixon wrote:

That's exactly what the ExtUtils::Installed was created for:

  use strict;
  use warnings;
  use ExtUtils::Installed;

  my $install = new ExtUtils::Installed;
  print map $_\n, $install-modules;
why on my linux box does that print

meatbop: 58:] ./find_modules.plx
Perl
meatbop: 59:]
and on my solaris box it does

vladimir: 58:] ./find*
C::Scan
Data::Flow
Perl
vladimir: 59:]
whereas the traversing code I posted yesterday
cf
http://www.wetware.com/drieux/pbl/perlTrick/traverse_inc.plx
meatbop: 74:] ./tra* | head
traversing /usr/lib/perl5/site_perl
traversing /usr/lib/perl5/5.8.1
Module: AnyDBM_File
Module: Attribute::Handlers
Module: Attribute::Handlers::demo::Demo
Module: Attribute::Handlers::demo::Descriptions
Module: Attribute::Handlers::demo::MyClass
Module: AutoLoader
Module: AutoSplit
Module: B
meatbop: 75:]
seems to get around that limitation?

Is the vendor supplied version of perl from
Linux for Suse and RedHat defective?
ciao
drieux
---

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: silly qn,.

2003-12-18 Thread david
Drieux wrote:

 
 On Dec 18, 2003, at 3:08 AM, Rob Dixon wrote:
 
 That's exactly what the ExtUtils::Installed was created for:

   use strict;
   use warnings;

   use ExtUtils::Installed;

   my $install = new ExtUtils::Installed;
   print map $_\n, $install-modules;
 
 why on my linux box does that print
 
 meatbop: 58:] ./find_modules.plx
 Perl
 meatbop: 59:]
 

[snip]

 Is the vendor supplied version of perl from
 Linux for Suse and RedHat defective?

it isn't broken. Perl is the core. to see the actual modules, use:

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

use ExtUtils::Installed;

print join(\n,grep /\.pm$/, ExtUtils::Installed-new-files('Perl')),\n;

__END__

prints:

...
/usr/local/lib/perl5/5.8.2/File/stat.pm
/usr/local/lib/perl5/5.8.2/Search/Dict.pm
/usr/local/lib/perl5/5.8.2/locale.pm
...

perldoc ExtUtils::Installed

david
-- 
sub'_{print@_ ;* \ = * __ ,\  \}
sub'__{print@_ ;* \ = * ___ ,\  \}
sub'___{print@_ ;* \ = *  ,\  \}
sub'{print@_,\n}{_+Just}(another)-(Perl)-(Hacker)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Please wait while I get your data ...

2003-12-18 Thread Mallik
Hi Bill,

We are also looking for the same solution

My problem is, I have to fetch data from tbe database
and display it on browser. The datbase is very huge.
It is taking more time to query the data. Mean while
timeout error is occuring on the browser.

So, we are also looking for the same solution you
are looking for. If you find any, pl. forward us.

NOTE: Database is Informix and we are using Perl CGI.

Thanks,
Mallik.

-Original Message-
From: Bill McCormick [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 9:42 PM
To: Cgiapp
Subject: [cgiapp] Please wait while I get your data ...


Hi all,

I'm trying to come up with a (simple?) way to display an intermediate page
to a user while waiting for MySQL to return results for a final page.
Comments, suggestions, advice, insight for the pros appreciated.


Thanks,


Bill


-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
  http://marc.theaimsgroup.com/?l=cgiappr=1w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
  http://marc.theaimsgroup.com/?l=cgiappr=1w=2
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]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: silly qn,.

2003-12-18 Thread drieux
On Dec 18, 2003, at 10:40 AM, david wrote:
[..]
#!/usr/bin/perl -w
use strict;
use ExtUtils::Installed;

print join(\n,grep /\.pm$/, 
ExtUtils::Installed-new-files('Perl')),\n;
[..]

clearly a step in the right direction.

But there is this minor nit that I find
a bit worrisome.
vladimir: 67:] ./tra* | grep -i Sol
Module: Sun::Solaris::BSM::_BSMparse
Module: Sun::Solaris::Kstat
Module: Sun::Solaris::Project
Module: Sun::Solaris::Utils
vladimir: 68:]
the version of perl at /usr/bin/perl tells me
that it aware of the @INC
Compiled at Aug 25 2002 12:19:33
  @INC:
/usr/local/lib/perl5/5.6.1/sun4-solaris-64int
/usr/local/lib/perl5/5.6.1
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris-64int
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/vendor_perl/5.6.1/sun4-solaris-64int
/usr/local/lib/perl5/vendor_perl/5.6.1
/usr/local/lib/perl5/vendor_perl
/usr/perl5/5.6.1/lib/sun4-solaris-64int
/usr/perl5/5.6.1/lib
/usr/perl5/site_perl/5.6.1/sun4-solaris-64int
/usr/perl5/site_perl/5.6.1
/usr/perl5/site_perl
/usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int
/usr/perl5/vendor_perl/5.6.1
/usr/perl5/vendor_perl
.
yet I would need to have fore-knowledge that it
was there to even try say:
 my $files;
 eval {
   $files = ExtUtils::Installed-new-files('Sun',all, 
'/usr/perl5/5.6.1');
 } ;
 die took weirdnesff: $@ if $@;

which still dies on me Unable to find the Sun...

Which will also fail if I try for say Sun::Solaris::Kstat

Don't get me wrong, I think that in the Main

	ExtUtils::Installed

is moving in the right general direction. I think that
it too still needs to be improved.
ciao
drieux
---

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



RE: Please wait while I get your data ...

2003-12-18 Thread Bob Showalter
Mallik wrote:
 Hi Bill,
 
 We are also looking for the same solution
 
 My problem is, I have to fetch data from tbe database
 and display it on browser. The datbase is very huge.
 It is taking more time to query the data. Mean while
 timeout error is occuring on the browser.
 
 So, we are also looking for the same solution you
 are looking for. If you find any, pl. forward us.
 
 NOTE: Database is Informix and we are using Perl CGI.

Randal has an article on this topic:

http://www.stonehenge.com/merlyn/LinuxMag/col39.html

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Ending a compound statement

2003-12-18 Thread Kenton Brede
Does a compound statement need to end with an else ?

I know  -

if (expression) {
statement;
} elsif (expression) { 
statement;
}

works but I've never seen a block like that in a book yet.  I usually
see something like -

if (expression) {
statement;
} elsif (expression) { 
statement;
} else {
statement;
}

I've posted the following code to use as an example.  Any critique of
the code in addition to my specific question is welcome:)  I just don't
see a reason to stick an else statement on the end of that block.

http://www.nixnotes.org/perl_dump.html

Thanks,
Kent

-- 
I am always doing that which I can not do, 
   in order that I may learn how to do it. --Pablo Picasso


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: Ending a compound statement

2003-12-18 Thread Guay Jean-Sébastien
Hello Kenton,

It depends on what you want to do. There is not really a right way, since
the two series of statements you mention will lead to different results.

(I added numbers to the different parts of your examples, makes them a bit
easier to follow)

 if (expression1) {
   statement1;
 } elsif (expression2) { 
   statement2;
 }

This evaluates expression1, and executes statement1 if true. If expression1
was false, it will evaluate expression2, and if that is true, will execute
statement2.

 if (expression1) {
 statement1;
 } elsif (expression2) { 
 statement2;
 } else {
   statement3;
 }

This will do the same as the first example, but if expression2 is false,
then it will enter the else and execute statement3. The main difference is
that you provide something to do for both the true and false cases for BOTH
your conditions, whereas in the first example, if expression2 was false it
simply exited and continued down in the file.

Hope this helps,

J-S


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: Ending a compound statement

2003-12-18 Thread Bob Showalter
Kenton Brede wrote:
 Does a compound statement need to end with an else ?

No.

 
 I know  -
 
 if (expression) {
   statement;
 } elsif (expression) {
   statement;
 }
 
 works but I've never seen a block like that in a book yet.  I usually
 see something like - 
 
 if (expression) {
 statement;
 } elsif (expression) {
 statement;
 } else {
   statement;
 }

Either way is fine. If you leave off the else block and all the conditions
are false, nothing is executed.

 
 I've posted the following code to use as an example.  Any critique of
 the code in addition to my specific question is welcome:)  I
 just don't
 see a reason to stick an else statement on the end of that block.
 
 http://www.nixnotes.org/perl_dump.html

Looks fine to me, except that if the last condition fails, the program will
silently end and the user won't know why. Does that matter?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Ending a compound statement

2003-12-18 Thread Owen
On Thu, 18 Dec 2003 13:35:17 -0600
Kenton Brede [EMAIL PROTECTED] wrote:

 Does a compound statement need to end with an else ?

Technically No. But what if you haven't covered all the options?


So I would suggest adding after the last elsif

} elsif ($string[0] =~ m/^\w/) { # limit search string
get_record($string[0]);
}


else {print Mmmm something real odd here\n}


-- 
Owen


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Fw: Win32::OLE, Simple Question

2003-12-18 Thread William Martell

- Original Message -
From: William Martell [EMAIL PROTECTED]
To: perl-win32-users [EMAIL PROTECTED]
Sent: Thursday, December 18, 2003 11:24 AM
Subject: Win32::OLE, Simple Question


 Hello All,

 Could anyone help me with this script.  I am trying to write an excel file
 with these column headers:

 'cus_id', 'customer_name', 'current', 'days1thru30', 'days31thru60',
 'days61thru90', 'over_90', 'on_hold', 'unap_cash', 'total_a_r'

 and under these headers I want to write rows of data.
 The data is held line by line in @columns array.

 This code does not work b/c it writes all the data on
 row 2 column A.  Which is exactly what I am telling it
 to do, I know.  But, I am trying to tell it to write
 one row of data and go to the next line or row and
 write the next row of data, over and over again
 until all the contents information is written.

 FYI.  artb46.da7 is a printed text report.

 Thank you all very much for your assistance.
 Will
 Dallas




 #!/perl
 # Perl script to read artb46.da7 printed report
 # takes all values and places them in excel
 # spreadsheet under date and report name
 # multiple sheets are added, one per day

 # NOTE: you should make a copy, don't work on the original
 use Win32::OLE;



 Win32::OLE::CreateObject(Excel.Application, $xl) ||
 die CreateObject: $!;
 # show it and add a new workbook
 $xl-{Visible} = 1;
 $xl-Workbooks-Add();
 #$x1-Cells.Select;
 #Selection.NumberFormat = @;

 open (INFILE, artb46_short.da7) || die Can't open artb46.da7 file.;



 @header = ('cus_id', 'customer_name', 'current', 'days1thru30',
 'days31thru60', 'days61thru90', 'over_90', 'on_hold', 'unap_cash',
 'total_a_r');

 # start at the top left
 $col = A; $row = 1;
 foreach $header (@header) {
 $cell = sprintf(%s%d, $col++, $row);
 # add it to Excel
 $xl-Range($cell)-{Value}  = $header;

 }


 while($line = INFILE){


 $cus_id = substr($line, 0, 6);
 $customer_name = substr($line, 7, 17);
 $current = substr($line, 26, 12);
 $days1thru30 = substr($line, 40, 12); #plus 11 (size column) plus 3 size
 space
 $days31thru60 = substr($line, 54, 12);
 $days61thru90 = substr($line, 68, 12);
 $over_90 = substr($line, 82, 12);
 $on_hold = substr($line, 96, 12);
 $unap_cash = substr($line, 108, 12);
 $total_a_r = substr($line, 120, 12);

 @column = ($cus_id, $customer_name, $current, $days1thru30, $days31thru60,
 $days61thru90,
 $over_90, $on_hold, $unap_cash, $total_a_r);

 $col = A;
 $row = 2;
 foreach $column (@column) {
 $cell = sprintf(%s%d, $col++, $row);
 # add it to Excel
 $xl-Range($cell)-{Value}  = $column;
 }


 }




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Ending a compound statement

2003-12-18 Thread drieux
On Dec 18, 2003, at 11:35 AM, Kenton Brede wrote:
[..]
I've posted the following code to use as an example.  Any critique of
the code in addition to my specific question is welcome:)  I just don't
see a reason to stick an else statement on the end of that block.
http://www.nixnotes.org/perl_dump.html
Nice piece of code; clearly starting in the right
general direction. I think I can see why you are
asking about whether or not one should do an 'else'
side of that tree.
So first things first, Do You REALLY want to
know what @ARGV was prior to calling GetOptions?
as a demonstration code:

print started with ARGS:\n;
print : $_   foreach(@ARGV);
print :\n;
my %options;
GetOptions (\%options, version, help);

while ( my ($k,$v) = each %options )
{
print $k - $v\n;
}
print Ended with ARGS:\n;
my @string = @ARGV;

print : $_  foreach(@string);
print :\n;
[jeeves: 9:] ./get_opt_demo.plx -h bob fred --version
started with ARGS:
: -h  : bob  : fred  : --version  :
version - 1
help - 1
Ended with ARGS:
: bob : fred :
[jeeves: 10:]
I take us on this misadventure to recommend my traditional
approach of basically Hiding the 'parse command line options'
in function of it's own that will resolve if all the
required things are there, and returning only
what needs to be dealt with, since the code is now Good to Go.
say something on the order of

	my ($argv, $options) = parse_cmd_line();

where of course $argv is an array ref and $options is
a hash ref of stuff that will be used in the code.
This way down in that

sub parse_cmd_line
{
...
if ( $options{version}  $options{help} )
{
print_version('help'); # tell print_version to call help and 
exit
} elsif ( $options{help} or scalar(@ARGV) != 1 )
{
# in the case we ONLY want one argument
help_message();
} elsif ( $options{version})
{
print_version(); # just the version string
} 
([EMAIL PROTECTED],\%options);
}
I of course implement your help_message() function with
the ability to take an argument like
sub help_message
{
my ($whiney_msg) = @_;
print $whiney_msg if $whiney_msg;
...
	}

Which of course gets me to your

sub get_record {
my ($reg_ex, $file ) = @_;
die needed a regular expression
unless($reg_ex);
$file ||= /etc/dhcpd.conf;
 open (DHCPD, $file) ||  die Can't open $file : $!\n;
 $/ = '}'; # paragraph delimiter
 while ( DHCPD ) {
if (m/$reg_ex/i) {print $_\n\n};
}
close (DHCPD) || die Error closing /etc/dhcpd $!\n;
}
This way you move towards reading IN the RegEx that
is passed to the function - and can pass in a 'test file'
for the duration of hacking out the test context...
HTH...

ciao
drieux
---

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: silly qn,.

2003-12-18 Thread Rob Dixon
Drieux wrote:

 On Dec 18, 2003, at 3:08 AM, Rob Dixon wrote:

  That's exactly what the ExtUtils::Installed was created for:
 
use strict;
use warnings;
 
use ExtUtils::Installed;
 
my $install = new ExtUtils::Installed;
print map $_\n, $install-modules;

 why on my linux box does that print

 meatbop: 58:] ./find_modules.plx
 Perl
 meatbop: 59:]

 and on my solaris box it does

 vladimir: 58:] ./find*
 C::Scan
 Data::Flow
 Perl
 vladimir: 59:]

 whereas the traversing code I posted yesterday
 cf
 http://www.wetware.com/drieux/pbl/perlTrick/traverse_inc.plx

 meatbop: 74:] ./tra* | head
 traversing /usr/lib/perl5/site_perl
 traversing /usr/lib/perl5/5.8.1
 Module: AnyDBM_File
 Module: Attribute::Handlers
 Module: Attribute::Handlers::demo::Demo
 Module: Attribute::Handlers::demo::Descriptions
 Module: Attribute::Handlers::demo::MyClass
 Module: AutoLoader
 Module: AutoSplit
 Module: B
 meatbop: 75:]

 seems to get around that limitation?

 Is the vendor supplied version of perl from
 Linux for Suse and RedHat defective?

ExtUtils::Installed relies on the modules having been installed
properly instead of just being copied into the right places.
It reads the .packlist files that result from the installation.
Seems like your stuff has been hacked.

Without .packlist there's no real way of establishing what
useable modules are installed. The best you can do is to list
all the 'package' statements in all the .pm files in @INC. A
lot of these packages internal to the module and aren't meant
to be 'use'd directly.

Cheers,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: silly qn,.

2003-12-18 Thread drieux
On Dec 18, 2003, at 12:41 PM, Rob Dixon wrote:
[..]
It reads the .packlist files that result from the installation.
Seems like your stuff has been hacked.
Vendor Supplied, Vendor Supported
I think is the phrase you were looking for.
Ironically, the modules that i did the build and
install of show up - eg:
libex: 57:] ./find* | head -12
Digest::MD5
HTML-Tree
HTML::Parser
HTML::Tagset
MIME::Base64
Net
Net::Telnet
Perl
URI
libwww-perl
/usr/local/lib/perl5/5.6.1/File/Spec/Functions.pm
/usr/local/lib/perl5/5.6.1/Shell.pm
libex: 58:]
Those modules that are of course there with the Perl
are your friends and mine, the underlying requirements
for installing libwww-perl and were installed the old
fashion way, from a re-build in the src tree...
But over on the stock Suse Linux box, none of the stuff
that is in vendor_site shows up in the process. Repeat
for Redhat 7.X and 9.X pro and vanilla.
So given that the OP had asked about knowing what
was on their Linux Box, it is not a complete Leap
of Faith to presume that they are working with the
'perl stuff' that delivered onto their box from
the Vendor with YAST - since clearly the OP had
not done the traditional old school tie of walking
their source tree to do the build and install per
OS type and CPU architecture to make the cut over
from pre perl5.8 to post perl5.8 but I am willing
to admit that is a presumption of mine.
Without .packlist there's no real way of establishing what
useable modules are installed. The best you can do is to list
all the 'package' statements in all the .pm files in @INC. A
lot of these packages internal to the module and aren't meant
to be 'use'd directly.
What gets even gigglier in all of this is that at
least the Freaks over at Apple 'did the right thing'
with their Foundation and PerlObjCBridge bridge elements.
But there is also the Irony, that my idiotic
	dtkp::WebMe

which of course does have the obligatory .packlist
file in the 'site_perl' section is not found...
So clearly there are more than a few issues that
will need to be cleaned up in the overall process here.


ciao
drieux
---

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



alternating loop

2003-12-18 Thread Mike Blezien
Hello,

been trying to come up with a way, while going through a loop to alternate a 
table cell color td/td

IE.
  while (..) {
   # To alternate a td cell color for each loop cycle so I end up
   # with something like this:
  # 1st loop
  td height=15nbsp;/td
  # 2nd loop.
  td height=15 bgcolor=#CCnbsp;/td
  # 3rd loop..
  td height=15nbsp;/td
  # 4th loop.
  td height=15 bgcolor=#CCnbsp;/td
  # and so on till the entire loop is completed
  }
hope this make sense :)

TIA.

--
MikemickaloBlezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



foreach

2003-12-18 Thread Eric Walker
Hello all
While traversing a loop across and array, how can I access array
positions further down the array, like say if I am on a loop looking at
position 23, how can I check the value of say position 24 or 32 while my
loop counter is on position 23.

Thanks
perl knucklehead





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: alternating loop

2003-12-18 Thread James Edward Gray II
On Dec 18, 2003, at 5:48 PM, Mike Blezien wrote:

Hello,

been trying to come up with a way, while going through a loop to 
alternate a table cell color td/td
See if this gets you thinking along the right lines:

my $odd = 1;
while () {  # some kind of loop...
if ($odd) {
# do something
$odd = 0;
}
else {
# do something else
$odd = 1;
}
}
__END__

James

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



RE: foreach

2003-12-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Eric Walker wrote:
 Hello all
 While traversing a loop across and array, how can I access array
 positions further down the array, like say if I am on a loop looking
 at position 23, how can I check the value of say position 24 or 32
 while my loop counter is on position 23.
 
 Thanks
 perl knucklehead

To do that you might want to use: for and check on whether an item is defined 
or not. Then you know the id you are on and can add or subtract depending on what you 
need.

So for a starter, you could try:

for(my $MyId=0;$MyIdscalar(@MyArray);$MyId++) {
next if ( ! defined $MyArray[$MyId] );
my $MyCheckId = $MyId + 2;  # looking at item two above
if ( $MyArray[$Myid]  $MyArray[$MyCheckid] ) {
 # do something
 }else {
 # do something else
 }
   }

I think you see what I mean.

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: foreach

2003-12-18 Thread Paul Johnson
On Thu, Dec 18, 2003 at 04:57:26PM -0700, Eric Walker wrote:

 Hello all
 While traversing a loop across and array, how can I access array
 positions further down the array, like say if I am on a loop looking at
 position 23, how can I check the value of say position 24 or 32 while my
 loop counter is on position 23.

Hmmm?  Add 1 or 9 to your loop counter?

Or have you not actually got a loop counter?  If that is the case the
easiest solution is probably to get one.

Or have I completely misunderstood?  Showing the code is usually more
productive than simply describing the problem.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: foreach

2003-12-18 Thread Eric Walker
I got it so I need a counter which sends me to a for loop instead of a
foreach.  Thanks..


perlknucklehead

On Thu, 2003-12-18 at 17:07, Paul Johnson wrote:
On Thu, Dec 18, 2003 at 04:57:26PM -0700, Eric Walker wrote:

 Hello all
 While traversing a loop across and array, how can I access array
 positions further down the array, like say if I am on a loop looking at
 position 23, how can I check the value of say position 24 or 32 while my
 loop counter is on position 23.

Hmmm?  Add 1 or 9 to your loop counter?

Or have you not actually got a loop counter?  If that is the case the
easiest solution is probably to get one.

Or have I completely misunderstood?  Showing the code is usually more
productive than simply describing the problem.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: foreach

2003-12-18 Thread James Edward Gray II
On Dec 18, 2003, at 5:57 PM, Eric Walker wrote:

Hello all
While traversing a loop across and array, how can I access array
positions further down the array, like say if I am on a loop looking at
position 23, how can I check the value of say position 24 or 32 while 
my
loop counter is on position 23.
for my $index (0..$#array) {
do_something( $array[$index] ); # where we are now
do_something( $array[ $index + 1 ] );   # ahead one
do_something( $array[ $index - 10 ] );  # behind ten
# etc...
}
Hope that helps.

James

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: alternating loop

2003-12-18 Thread Randy W. Sims
On 12/18/2003 7:00 PM, James Edward Gray II wrote:
On Dec 18, 2003, at 5:48 PM, Mike Blezien wrote:

Hello,

been trying to come up with a way, while going through a loop to 
alternate a table cell color td/td


See if this gets you thinking along the right lines:

my $odd = 1;
while () {# some kind of loop...
if ($odd) {
# do something
$odd = 0;
}
else {
# do something else
$odd = 1;
}
}
or

my $alt;
while () {# some kind of loop...
if ($alt = !$alt) {
# do something
}
else {
# do something else
}
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: foreach

2003-12-18 Thread Jeff Westman
Eric Walker [EMAIL PROTECTED] wrote:

 I got it so I need a counter which sends me to a for loop instead of a
 foreach.  Thanks..
 
 perlknucklehead

I believe that 'for' and 'foreach' are completely interchangable. I remember
reading somewhere that one was a synonym for the other.

Maybe someone who is more familiar with the internals can confim that.


-Jeff

 
 On Thu, 2003-12-18 at 17:07, Paul Johnson wrote:
 On Thu, Dec 18, 2003 at 04:57:26PM -0700, Eric Walker wrote:
 
  Hello all
  While traversing a loop across and array, how can I access array
  positions further down the array, like say if I am on a loop looking
 at
  position 23, how can I check the value of say position 24 or 32 while
 my
  loop counter is on position 23.
 
 Hmmm?  Add 1 or 9 to your loop counter?
 
 Or have you not actually got a loop counter?  If that is the case the
 easiest solution is probably to get one.
 
 Or have I completely misunderstood?  Showing the code is usually more
 productive than simply describing the problem.
 
 -- 
 Paul Johnson - [EMAIL PROTECTED]
 http://www.pjcj.net
 
 
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 http://learn.perl.org/ http://learn.perl.org/first-response
 
 


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: alternating loop

2003-12-18 Thread Paul Johnson
On Thu, Dec 18, 2003 at 07:26:03PM -0500, Randy W. Sims wrote:
 On 12/18/2003 7:00 PM, James Edward Gray II wrote:
 On Dec 18, 2003, at 5:48 PM, Mike Blezien wrote:
 
 Hello,
 
 been trying to come up with a way, while going through a loop to 
 alternate a table cell color td/td
 
 
 See if this gets you thinking along the right lines:
 
 my $odd = 1;
 while () {# some kind of loop...
 if ($odd) {
 # do something
 $odd = 0;
 }
 else {
 # do something else
 $odd = 1;
 }
 }
 
 
 or
 
 my $alt;
 while () {# some kind of loop...
 if ($alt = !$alt) {
 # do something
 }
 else {
 # do something else
 }
 }

or

while () {
if ($|--) {
# do something
}
else {
# do something else
}
}

Oh, no.  Hold on.  On second thoughts ...

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: foreach

2003-12-18 Thread Paul Johnson
On Thu, Dec 18, 2003 at 04:31:20PM -0800, Jeff Westman wrote:
 Eric Walker [EMAIL PROTECTED] wrote:
 
  I got it so I need a counter which sends me to a for loop instead of a
  foreach.  Thanks..
  
  perlknucklehead
 
 I believe that 'for' and 'foreach' are completely interchangable. I remember
 reading somewhere that one was a synonym for the other.

That is correct, though often people will refer to foreach meaning

  foreach VAR (LIST) BLOCK

and to for meaning

  for (EXPR; EXPR; EXPR) BLOCK

perldoc perlsyn

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: alternating loop

2003-12-18 Thread Jeff Westman
Paul Johnson [EMAIL PROTECTED] wrote:

 On Thu, Dec 18, 2003 at 07:26:03PM -0500, Randy W. Sims wrote:
  On 12/18/2003 7:00 PM, James Edward Gray II wrote:
  On Dec 18, 2003, at 5:48 PM, Mike Blezien wrote:
  
  Hello,
  
  been trying to come up with a way, while going through a loop to 
  alternate a table cell color td/td
  
  
  See if this gets you thinking along the right lines:
  
  my $odd = 1;
  while () {# some kind of loop...
  if ($odd) {
  # do something
  $odd = 0;
  }
  else {
  # do something else
  $odd = 1;
  }
  }
  
  
  or
  
  my $alt;
  while () {# some kind of loop...
  if ($alt = !$alt) {
  # do something
  }
  else {
  # do something else
  }
  }
 
 or
 
 while () {
 if ($|--) {
 # do something

HUH??   Why are you decrementing the $OUTPUT_AUTOFLUSH variable as an
'alternate' for loop???!

Sorry, I don't follow you here.


-JW



 }
 else {
 # do something else
 }
 }
 
 Oh, no.  Hold on.  On second thoughts ...
 
 -- 
 Paul Johnson - [EMAIL PROTECTED]
 http://www.pjcj.net


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: alternating loop

2003-12-18 Thread Mike Blezien
Thx's James worked fine,... the simplest way is usually the most obvious 
over-looked way :)

MikemickaloBlezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
James Edward Gray II wrote:
On Dec 18, 2003, at 5:48 PM, Mike Blezien wrote:

Hello,

been trying to come up with a way, while going through a loop to 
alternate a table cell color td/td


See if this gets you thinking along the right lines:

my $odd = 1;
while () {# some kind of loop...
if ($odd) {
# do something
$odd = 0;
}
else {
# do something else
$odd = 1;
}
}
__END__

James


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: alternating loop

2003-12-18 Thread Ricardo SIGNES
* Mike Blezien [EMAIL PROTECTED] [2003-12-18T18:48:23]
 been trying to come up with a way, while going through a loop to
 alternate a table cell color td/td

I always do something more like:

my $i;
while () {
print tr class='r, ($i++%2), ' ... /tr\n
}

The benefit here is that someday I can replace the 2 with 3 and have
three behaviors.  Yes, that's a minor benefit.

-- 
rjbs


pgp0.pgp
Description: PGP signature


Re: alternating loop

2003-12-18 Thread James Edward Gray II
On Dec 18, 2003, at 8:54 PM, Ricardo SIGNES wrote:

* Mike Blezien [EMAIL PROTECTED] [2003-12-18T18:48:23]
been trying to come up with a way, while going through a loop to
alternate a table cell color td/td
I always do something more like:

my $i;
while () {
print tr class='r, ($i++%2), ' ... /tr\n
}
The benefit here is that someday I can replace the 2 with 3 and have
three behaviors.  Yes, that's a minor benefit.
The minus is of course readability.  ;)  You could accomplish something 
similar with the ternary operator, to do it as Mike was, without 
stylesheets.

Ironically, this was my first thought, but I changed my mind while I 
was typing it.  I don't think an extra line or two is a bad price to 
pay for understanding what's going on.  Of course, I'm pretty dumb and 
need all the visual clues I can get.

James

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



how to remove a ^M charaters from a variable

2003-12-18 Thread David Inglis

I am reading in a csv file and it has a control character ^M at the end
of each line how can I remove these charaters, I have tried the following
and had no success.

$a=~s/\^M//;
$a=~s/^M//;


Any help appreciated thanks.


-- 
Regards



David Inglis
0408502342


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: how to remove a ^M charaters from a variable

2003-12-18 Thread Randy W. Sims
On 12/20/2003 8:21 AM, David Inglis wrote:

I am reading in a csv file and it has a control character ^M at the end
of each line how can I remove these charaters, I have tried the following
and had no success.
$a=~s/\^M//;
$a=~s/^M//;
Any help appreciated thanks.


^M is the carriage return. Try s/\x0D//;

Regards,
Randy.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Zip using Perl

2003-12-18 Thread Manish Uskaikar
Hi All,

I would like to zip a file using perl script. I used following command:-

system (zip zip name file name);

However this command fails when the filename is more than 8 characters. Since DOS does 
not support more than 8 characters. Is there any way by which I can zip a file, whose 
name is 9+ characters long? I am working on Windows 2000.

Regards

Manish U

--
The information contained in this message is confidential and proprietary to 
KnowledgeWorks Global Limited, Mumbai, India. It is intended only for the use of the 
individual or entity to whom it is addressed. If you are not the intended recipient, 
or the authorized agent thereof, you are hereby notified that any disclosure, use, 
distribution, dissemination or copying in any form of any information contained in 
this message is strictly prohibited. If you have received this message by mistake or 
error, please notify us immediately by return email to the sender or by fax on number 
+91-22-28291673 and delete all copies of the original message.

Phone : 91-22-56971177  Ext 323


Re: Zip using Perl

2003-12-18 Thread Andrew Gaffney
Manish Uskaikar wrote:
Hi All,

I would like to zip a file using perl script. I used following command:-

system (zip zip name file name);

However this command fails when the filename is more than 8 characters. Since DOS does not support more than 8 characters. Is there any way by which I can zip a file, whose name is 9+ characters long? I am working on Windows 2000.
As long as you are using Win9x and up, you can do something like:

system zip \zip name\ \file name\; # (I don't know if DOS supports single quotes)

If you're looking for a more universal solution, here would probably be a good place to start:

http://search.cpan.org/search?query=zipmode=module

--
Andrew Gaffney
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: Zip using Perl

2003-12-18 Thread Randy W. Sims
On 12/19/2003 12:38 AM, Manish Uskaikar wrote:

Hi All,

I would like to zip a file using perl script. I used following command:-

system (zip zip name file name);

However this command fails when the filename is more than 8 characters. Since DOS does not support more than 8 characters. Is there any way by which I can zip a file, whose name is 9+ characters long? I am working on Windows 2000.
Try Archive::Zip

Regards,
Randy.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response