htaccess and CGI Perl passwording

2003-07-24 Thread Gordon Low

Wondered if someone can help, am floundering about trying to work out
whether to use htaccess or a database type solution in order to restrict
access to my personal website. 

Have looked at perl module Apache::Htaccess module and this raises the
same question I have with the htaccess solution, can I use a different
password file to my /etc/passwd file. I don't particularly want people
who log in to the web page given access to the system and I am using
shadow passwording which I am sure I have seen is not allowed with
htaccess. Trouble is I am having trouble finding out how to create a
seperate password file (am using Linux RH 8.0).

Then again this newbie is struggling, want to restrict access to certain
pages and thought another solution might be to create a database, and
use a cookie to track the user (with the u/n and password in a digest).
Is there a perl module which can help here, find I am still not familiar
with CPAN and it is taking a long time.

Any help much appreciated.

Thanks 

Gordon Low


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



modifing and writing to a file

2003-07-24 Thread Ged
Hi all,

I am very new to perl (2 days) but am finding it very rewarding. I have however 
stumbled across a problem hopefully somebody can help me with.

I am trying to open a file, change the text from lowercase to uppercase and rewrite it 
to a backup file. However, I only seem to be duplicating the original file. Here is my 
code:

$stuff=c:/ged/perl files/stuff.txt;
$backup=c:/ged/perl files/stuff.bk;

open STUFF, $stuff or die Cannot open $stuff for read :$!;
open BACKUP, $backup or die Cannot open $backup for write :$!;

while (STUFF) {
s/a-z/A-Z/g;
print BACKUP $_;
}

can anyone see where I am going wrong.

Thanks,

Ged.

-
Email provided by http://www.ntlhome.com/



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



RE: modifing and writing to a file

2003-07-24 Thread Marcos . Rebelo
if you are new to perl try

perl -e print uc($_) while (); c:/ged/perl files/stuff.txt  c:/ged/perl
files/stuff.bk

-Original Message-
From: Ged [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 10:00 AM
To: [EMAIL PROTECTED]
Subject: modifing and writing to a file


Hi all,

I am very new to perl (2 days) but am finding it very rewarding. I have
however stumbled across a problem hopefully somebody can help me with.

I am trying to open a file, change the text from lowercase to uppercase and
rewrite it to a backup file. However, I only seem to be duplicating the
original file. Here is my code:

$stuff=c:/ged/perl files/stuff.txt;
$backup=c:/ged/perl files/stuff.bk;

open STUFF, $stuff or die Cannot open $stuff for read :$!;
open BACKUP, $backup or die Cannot open $backup for write :$!;

while (STUFF) {
s/a-z/A-Z/g;
print BACKUP $_;
}

can anyone see where I am going wrong.

Thanks,

Ged.

-
Email provided by http://www.ntlhome.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: modifing and writing to a file

2003-07-24 Thread Janek Schleicher
Ged wrote at Thu, 24 Jul 2003 08:00:04 +:

 I am very new to perl (2 days) but am finding it very rewarding. I have however 
 stumbled across a problem hopefully somebody can help me with.
 
 I am trying to open a file, change the text from lowercase to uppercase and rewrite 
 it to a backup file. However, I only seem to be duplicating the original file. Here 
 is my code:
 
 $stuff=c:/ged/perl files/stuff.txt;
 $backup=c:/ged/perl files/stuff.bk;
 
 open STUFF, $stuff or die Cannot open $stuff for read :$!;
 open BACKUP, $backup or die Cannot open $backup for write :$!;
 
 while (STUFF) {
   s/a-z/A-Z/g;
   ^^

You meant tr instead.
(The substitution really changes all occurrences of the string a-z to
A-Z.

   print BACKUP $_;

Please read
perldoc -q 'What\'s wrong with always quoting $vars'

 }

However, there is a shorter other way, as Perl has a builtin uppercase
function:

while (STUFF) {
print BACKUP, uc;
}

Please read 
perldoc -f uc
for details.


Greetings,
Janek

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



RE: modifing and writing to a file

2003-07-24 Thread NYIMI Jose (BMB)
s/a-z/A-Z/g should be s/[a-z]/[A-Z]/g;

You also use uc function like this :
print BACKUP uc $_;
#or
#print BACKUP uc ; 

C:\perldoc -f uc
uc EXPR
uc  Returns an uppercased version of EXPR. This is the internal
function implementing the \U escape in double-quoted
strings.
Respects current LC_CTYPE locale if use locale in force.
See
the perllocale manpage. Under Unicode (use utf8) it uses
the
standard Unicode uppercase mappings. (It does not attempt to
do
titlecase mapping on initial letters. See ucfirst for
that.)

If EXPR is omitted, uses $_.


C:\

-Original Message-
From: Ged [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 24, 2003 10:00 AM
To: [EMAIL PROTECTED]
Subject: modifing and writing to a file


Hi all,

I am very new to perl (2 days) but am finding it very rewarding. I have
however stumbled across a problem hopefully somebody can help me with.

I am trying to open a file, change the text from lowercase to uppercase
and rewrite it to a backup file. However, I only seem to be duplicating
the original file. Here is my code:

$stuff=c:/ged/perl files/stuff.txt;
$backup=c:/ged/perl files/stuff.bk;

open STUFF, $stuff or die Cannot open $stuff for read :$!; open
BACKUP, $backup or die Cannot open $backup for write :$!;

while (STUFF) {
s/a-z/A-Z/g;
print BACKUP $_;
}

can anyone see where I am going wrong.

Thanks,

Ged.

-
Email provided by http://www.ntlhome.com/



-- 
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: modifing and writing to a file

2003-07-24 Thread Sudarshan Raghavan
NYIMI Jose (BMB) wrote:

s/a-z/A-Z/g should be s/[a-z]/[A-Z]/g;

Character classes are only possible in the matching part of the regex, 
not in the replacement part. You regex says substitute all occurences of 
a lowercase alphabet with the string '[A-Z]'



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


Re: Re: modifing and writing to a file

2003-07-24 Thread Ged
ahhh, thanks. Yes, that makes sense now.

after reading up on the 'uc' function, I have now got my program to work as required.

Thanks to all for their input.

Ged.

 
 From: Sudarshan Raghavan [EMAIL PROTECTED]
 Date: 2003/07/24 Thu AM 08:43:55 GMT
 To: [EMAIL PROTECTED]
 Subject: Re: modifing and writing to a file
 
 NYIMI Jose (BMB) wrote:
 
 s/a-z/A-Z/g should be s/[a-z]/[A-Z]/g;
 
 
 Character classes are only possible in the matching part of the regex, 
 not in the replacement part. You regex says substitute all occurences of 
 a lowercase alphabet with the string '[A-Z]'
 
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
Email provided by http://www.ntlhome.com/



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



eleminating dupes in @list

2003-07-24 Thread Juergen Bertram
hi,

I need a procedure to eleminate dupes in a @list

Ex: @list1 = qw(two one two zero six five six seven zero);

should be changed to:

@list2 = qw(two one zero six five seven);

There's no need to sort the list.

tnx 
...and cu
Juergen

-- 
Juergen Bertram  __  mailto:[EMAIL PROTECTED]
Belwue-KoordinationTel: 0711/685-5797
Rechenzentrum der Universitaet Stuttgart   Fax:
0711/678-8363   
Allmandring 3A, 70550 Stuttgart, http://www.belwue.de/support/ulm

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



RE: eleminating dupes in @list

2003-07-24 Thread Marcos . Rebelo
@list1 = qw(two one two zero six five six seven zero);
@list2 = keys(%{{map{$_=1}(@list1)}});

-Original Message-
From: Juergen Bertram [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 11:00 AM
To: [EMAIL PROTECTED]
Subject: eleminating dupes in @list


hi,

I need a procedure to eleminate dupes in a @list

Ex: @list1 = qw(two one two zero six five six seven zero);

should be changed to:

@list2 = qw(two one zero six five seven);

There's no need to sort the list.

tnx 
...and cu
Juergen

-- 
Juergen Bertram  __  mailto:[EMAIL PROTECTED]
Belwue-KoordinationTel: 0711/685-5797
Rechenzentrum der Universitaet Stuttgart   Fax:
0711/678-8363   
Allmandring 3A, 70550 Stuttgart, http://www.belwue.de/support/ulm

-- 
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]



regex problem

2003-07-24 Thread awarsd
Hi,

I have a number $page = 500;
now i want to check that if $page matches a word character then make $page
=1;
so originally i did this
my $page =500;
if(($page =~ /\w/) || ($page = 0)){
$page=1;
}
print$page;

since it always returns $page = 1; then i did this
if(($page =~ /(\w)/) || ($page = 0)){
$page=$1;
}
so it displayed the word 5, how come 5 is considered as a word??
so to fix it i just did
if(($page =~ /(\D)/) || ($page = 0)){
$page=$1;
}
And everything worked ok!!

any help is appreciated



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



comparing more than one list

2003-07-24 Thread Mike . Elmore
Hi to [EMAIL PROTECTED] This is my first posting so please be gentle.
I've followed the comparing two lists thread with interest. What I'd like
to do is to compare 16 lists to see whether each of the entries in e.g.
list 1 is present in one or more of the other 15. Each entry in the list
consists of a position, a string and a score. I would like to compare just
the position/strings for presence/absence in other lists.
Any ideas?
e.g.
List1
97, vrmaqpwsl 2.82
440, lrrlaaler 2.1
673, lvsangqsi 1.9
576, vyrakaydl 1.6
716, vvregtyll 1.2
623, lvlatrngl 0.9
127, mrytearlt 0.89
170, fpnllangs 0.7
408, irasetvdi 0.7
558, ffvcsthdl 0.7
96, lvrmaqpws 0.57
622, ylvlatrng 0.49
251, irmrgvvev 0.4
270, vitelpyqv 0.3
314, ivieikrda 0.29
690, lrpmgrats 0.2
379, yrlrkaner 0.2
783, virtaarqv 0.19
283, fitsiaeqv 0.1
12, ldriepvdi 0.1
405, ialiraset 0.1
326, vvinnlykh 0.04

List2
97, vrmaqpwsl 3.98
440, lrrlaaler 3.1
673, lvsangqsi 2.9
576, vyrakaydl 2.6
716, vvregtyll 2.2
623, lvlatrngl 1.9
127, mrytearlt 1.89
408, irasetvdi 1.7
96, lvrmaqpws 1.57
251, irmrgvvev 1.4
270, vitelpyqv 1.3
314, ivieikrda 1.29
690, lrpmgrats 1.2
783, virtaarqv 1.19
12, ldriepvdi 1.1
405, ialiraset 1.1
326, vvinnlykh 1.04
33, msvivgral 0.99

List 3
356, lrldqliry 6.4
705, fniddrlls 5.9
478, ivrdelaei 5.9
318, ikrdavakv 5.6
753, vmydrrrgr 4.8
690, lrpmgrats 4.6
408, irasetvdi 4.5
96, lvrmaqpws 4.3
251, irmrgvvev 4.3
623, lvlatrngl 3.97
681, irfsatdea 3.9
801, vrlmnlgeg 3.9
549, lkqddivah 3.8
784, irtaarqvr 3.6
440, lrrlaaler 3.6
97, vrmaqpwsl 3.46
326, vvinnlykh 3.45

etc.



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



Re: eleminating dupes in @list

2003-07-24 Thread Juergen Bertram
Hi Marcos,

Thanks again, it works fine

jb


[EMAIL PROTECTED] wrote:
 
 @list1 = qw(two one two zero six five six seven zero);
 @list2 = keys(%{{map{$_=1}(@list1)}});
 
 -Original Message-
 From: Juergen Bertram [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 24, 2003 11:00 AM
 To: [EMAIL PROTECTED]
 Subject: eleminating dupes in @list
 
 hi,
 
 I need a procedure to eleminate dupes in a @list
 
 Ex: @list1 = qw(two one two zero six five six seven zero);
 
 should be changed to:
 
 @list2 = qw(two one zero six five seven);
 
 There's no need to sort the list.
 
 tnx
 ...and cu
 Juergen
 
 --

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

-- 
Juergen Bertram  __  mailto:[EMAIL PROTECTED]
Belwue-KoordinationTel: 0711/685-5797
Rechenzentrum der Universitaet Stuttgart   Fax:
0711/678-8363   
Allmandring 3A, 70550 Stuttgart, http://www.belwue.de/support/ulm

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



Re: Re: modifing and writing to a file (solved)

2003-07-24 Thread Ged
In case anyone else was following this, and for the search purposes in the archives, 
with the help on this list and the perldocs, I completed my program.


#!usr/bin/perl

# This program will change an original file(s) from lowercase to uppercase
# It will then write the mods to the original file and make a backup of the old one
# If you don't want a backup, assign a null string to $^I

if (@ARGV) {
$^I=.bk;
while () {
print uc;
} 
} else {
print Please enter file you wish to modify in the command line\n;
print e.g. program.pl file1.txt file2.txt file3.txt\n;
}


Hopefully it may be of some use to somebody else starting out and stumbling in this 
area.



 
 From: Ged [EMAIL PROTECTED]
 Date: 2003/07/24 Thu AM 08:47:23 GMT
 To: [EMAIL PROTECTED]
 Subject: Re: Re: modifing and writing to a file
 
 ahhh, thanks. Yes, that makes sense now.
 
 after reading up on the 'uc' function, I have now got my program to work as required.
 
 Thanks to all for their input.
 
 Ged.
 
  
  From: Sudarshan Raghavan [EMAIL PROTECTED]
  Date: 2003/07/24 Thu AM 08:43:55 GMT
  To: [EMAIL PROTECTED]
  Subject: Re: modifing and writing to a file
  
  NYIMI Jose (BMB) wrote:
  
  s/a-z/A-Z/g should be s/[a-z]/[A-Z]/g;
  
  
  Character classes are only possible in the matching part of the regex, 
  not in the replacement part. You regex says substitute all occurences of 
  a lowercase alphabet with the string '[A-Z]'
  


-
Email provided by http://www.ntlhome.com/



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



installing module

2003-07-24 Thread awarsd
Hi,

I would like to install Time::Hires
so i have a path  in cgi script
use lib '/home/sites/prog/www/Module';
now inside the Module folder i created a new folder called Time
inside that folder I put Hires.pm
And the program says It can NOT found module

Any help is appreciated



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



qw versus qx

2003-07-24 Thread JOHN FISHER
Is qw for holding list of data and qx is for running commands?
Do they both indicate a list context?
Thanks,
John



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



RE: installing module

2003-07-24 Thread NYIMI Jose (BMB)
The SYNOPSIS of lib module is:
use lib LIST

The LIST stuff is important (LIST != EXPR).

So try:
use lib qw(/home/sites/prog/www/Module);
#or
use lib ('/home/sites/prog/www/Module');

Both should work.

José.

-Original Message-
From: awarsd [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 24, 2003 11:52 AM
To: [EMAIL PROTECTED]
Subject: installing module


Hi,

I would like to install Time::Hires
so i have a path  in cgi script
use lib '/home/sites/prog/www/Module';
now inside the Module folder i created a new folder called Time inside that folder I 
put Hires.pm And the program says It can NOT found module

Any help is appreciated



-- 
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: installing module

2003-07-24 Thread awarsd
Hi,

I tried both ways and no luck:-( still give me same error:

Can't locate loadable object for module Time::HiRes in @INC (@INC contains:
/home/sites/prog/www/Module /usr/lib/perl5/5.6.1/i386-linux
/usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux
/usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0/i386-linux
/usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at search.pl line
14

Anthony


Nyimi Jose [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
The SYNOPSIS of lib module is:
use lib LIST

The LIST stuff is important (LIST != EXPR).

So try:
use lib qw(/home/sites/prog/www/Module);
#or
use lib ('/home/sites/prog/www/Module');

Both should work.

José.

-Original Message-
From: awarsd [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 11:52 AM
To: [EMAIL PROTECTED]
Subject: installing module


Hi,

I would like to install Time::Hires
so i have a path  in cgi script
use lib '/home/sites/prog/www/Module';
now inside the Module folder i created a new folder called Time inside that
folder I put Hires.pm And the program says It can NOT found module

Any help is appreciated



-- 
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: regex problem

2003-07-24 Thread Sudarshan Raghavan
awarsd wrote:

Hi,

I have a number $page = 500;
now i want to check that if $page matches a word character then make $page
=1;
so originally i did this
my $page =500;
if(($page =~ /\w/) || ($page = 0)){
$page=1;
}
print$page;
since it always returns $page = 1; then i did this
if(($page =~ /(\w)/) || ($page = 0)){
$page=$1;
}
so it displayed the word 5, how come 5 is considered as a word??
perldoc perlre
\w is alphanumeric plus '_', i.e. [a-zA-Z0-9_]
so to fix it i just did
if(($page =~ /(\D)/) || ($page = 0)){
$page=$1;
}
And everything worked ok!!

any help is appreciated



 



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


RE: qw versus qx

2003-07-24 Thread Hanson, Rob
 Is qw for holding list of data and qx is for running commands?

yes.

 Do they both indicate a list context?

no.

qw{word word} is the same as ('word', 'word')... and qx{foo bar} is the same
as `foo bar`.  qx{} is just there if you need an alternate syntax to ``,
like if you needed to use a backtick in your command.

Rob

-Original Message-
From: JOHN FISHER [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 7:52 AM
To: [EMAIL PROTECTED]
Subject: qw versus qx


Is qw for holding list of data and qx is for running commands?
Do they both indicate a list context?
Thanks,
John



-- 
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: qw versus qx

2003-07-24 Thread Dan Muey
 
 Is qw for holding list of data and qx is for running 
 commands? Do they both indicate a list context? Thanks, John

 perldoc -f qq
 perlop Regexp Quote-Like Operators

 my @stuff = qw(hi bye joe mama);
 my @cmdln = qx(cat monkey.txt| grep fred);
 my $cmdln = qx(cat monkey.txt| grep fred);
 print qq(I said Foo you bar and they were like no way);

HTH

DMuey
 
 
 
 -- 
 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: regex problem

2003-07-24 Thread LI NGOK LAM

 I have a number $page = 500;
 now i want to check that if $page matches a word character then make $page
 =1;

$page = 1 unless ( $page =~ /\d/ );
or
$page = 1 if ($page =~ /\D/ );


 so originally i did this
 my $page =500;
 if(($page =~ /\w/) || ($page = 0)){
 $page=1;
 }
 print$page;

\w means [a-zA-Z0-9], 5 is one of them.


 since it always returns $page = 1; then i did this
 if(($page =~ /(\w)/) || ($page = 0)){
 $page=$1;
 }
 so it displayed the word 5, how come 5 is considered as a word??

Since in string 500, the regex catch 5 as a word at the very first,
and the regex action is ended and so $1 carries 5. You then assing
$page =  $1, so $page = 5;


 so to fix it i just did
 if(($page =~ /(\D)/) || ($page = 0)){
 $page=$1;
 }
 And everything worked ok!!

It doesn't ok... since \D means [^0-9], so the block doesn't
run at all, so $page still = 500 So, if $page = END, then,
you will fine $page = E after this block.

Note : The $DIGIT means the sequence for results from catching
matched pattern in the blankets you assigned. It means, $1 is the
first match , $2 is the second match, and so on...

$page = 500;

$page =~ /(\d)(\d)(\d)/;
$page = $3 . $1;
print $page ; # you got 05, the last and first digit...

HTH




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



RE: eleminating dupes in @list

2003-07-24 Thread Dan Muey
 @list1 = qw(two one two zero six five six seven zero);
 @list2 = keys(%{{map{$_=1}(@list1)}});
 hi,

Howdy

 
 I need a procedure to eleminate dupes in a @list
 
 Ex: @list1 = qw(two one two zero six five six seven zero);
 
 should be changed to:
 
 @list2 = qw(two one zero six five seven);
 

Here's a couple waysthat were recommended to me that 
don't have the overhead (if any) of map:

@list2 = do { my %t;grep !$t{$_}++, @list1 };
@list2 = keys %{ my %s;@[EMAIL PROTECTED] = ();\%s; };

Does anyone know for sure if they both ot one or the other 
keeps the order of the elements in the array? 
(IE - First instance first, like in the OP example)

HTH

DMuey

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



RE: eleminating dupes in @list

2003-07-24 Thread Bob Showalter
Dan Muey wrote:
  @list1 = qw(two one two zero six five six seven zero);
  @list2 = keys(%{{map{$_=1}(@list1)}});
   hi,
 
 Howdy
 
   
   I need a procedure to eleminate dupes in a @list
   
   Ex: @list1 = qw(two one two zero six five six seven zero);
   
   should be changed to:
   
   @list2 = qw(two one zero six five seven);
   
 
 Here's a couple waysthat were recommended to me that
 don't have the overhead (if any) of map:
 
 @list2 = do { my %t;grep !$t{$_}++, @list1 };
 @list2 = keys %{ my %s;@[EMAIL PROTECTED] = ();\%s; };

This should be @list1 to keep the examples in parallel

 
 Does anyone know for sure if they both ot one or the other
 keeps the order of the elements in the array?
 (IE - First instance first, like in the OP example)

The first one maintains order. The second does not.

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



RE: eleminating dupes in @list

2003-07-24 Thread Dan Muey

  @list2 = do { my %t;grep !$t{$_}++, @list1 };
  @list2 = keys %{ my %s;@[EMAIL PROTECTED] = ();\%s; };
 
 This should be @list1 to keep the examples in parallel

Oops soory folks!

  
  Does anyone know for sure if they both ot one or the other 
 keeps the 
  order of the elements in the array? (IE - First instance 
 first, like 
  in the OP example)
 
 The first one maintains order. The second does not.

Cool thanks!
Dan

 

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



Re: RE: printing html symbols

2003-07-24 Thread mgoland

Thanks Dan, how would I go about printing a string like:


TRTH colspan=2Board # TH colspan=2Color #TH colspan=2model #TH 
colspan=2Serial #



- Original Message -
From: Dan Muey [EMAIL PROTECTED]
Date: Wednesday, July 23, 2003 10:21 am
Subject: RE: printing html symbols

 
  Hi all,
 
 Howdy
 
  
  I need to print out a whole bunch of HTML in my cgi script. 
  How can I print things out with out escaping all the 
  necessary symbols ??
  
 
 Use single quotes, use qq(), q(), qx() etc
 Use here documents (you still have to escape @ signs though)
 
 print HTML;
   my html here
 
 HTML
 
 Or use CGI.pm to creta the html for you
 
 Check out perldoc and cpan for how to use someof these things
 
 HTH
 
 Dan
  
  Mark G
  
  
  -- 
  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: RE: printing html symbols

2003-07-24 Thread Dan Muey

 Thanks Dan, how would I go about printing a string like:
 
 
 TRTH colspan=2Board # TH colspan=2Color #TH 
 colspan=2model #TH colspan=2Serial # 
 

If it was just that one line I'd use qq() like so:

print qq(TRTH colspan=2Board # TH colspan=2Color #TH colspan=2model 
#TH colspan=2Serial # );

If it was mnore I'd use a here doc:

print STUFF;
TRTH colspan=2Board # TH colspan=2Color #TH colspan=2model #TH 
colspan=2Serial # 

STUFF

HTH

DMuey

 
 - Original Message -
 From: Dan Muey [EMAIL PROTECTED]
 Date: Wednesday, July 23, 2003 10:21 am
 Subject: RE: printing html symbols
 
  
   Hi all,
  
  Howdy
  
   
   I need to print out a whole bunch of HTML in my cgi script.
   How can I print things out with out escaping all the 
   necessary symbols ??
   
  
  Use single quotes, use qq(), q(), qx() etc
  Use here documents (you still have to escape @ signs though)
  
  print HTML;
  my html here
  
  HTML
  
  Or use CGI.pm to creta the html for you
  
  Check out perldoc and cpan for how to use someof these things
  
  HTH
  
  Dan
   
   Mark G
   
   
   --
   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 module

2003-07-24 Thread wiggins
In your original post you said you put the file 'Hires.pm' into the 'Time' directory, 
but this should be 'HiRes.pm'. Typo in your message or wrong file name? Some systems 
are not case sensitive but others are...

Also rather than copying the single file into place it may be better to install with 
CPAN. If you need help installing to a different directory just ask or check the 
archives of this list...

http://danconia.org


On Thu, 24 Jul 2003 14:03:31 +0200, awarsd [EMAIL PROTECTED] wrote:

 Hi,
 
 I tried both ways and no luck:-( still give me same error:
 
 Can't locate loadable object for module Time::HiRes in @INC (@INC contains:
 /home/sites/prog/www/Module /usr/lib/perl5/5.6.1/i386-linux
 /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux
 /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0/i386-linux
 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at search.pl line
 14
 
 Anthony
 
 
 Nyimi Jose [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 The SYNOPSIS of lib module is:
 use lib LIST
 
 The LIST stuff is important (LIST != EXPR).
 
 So try:
 use lib qw(/home/sites/prog/www/Module);
 #or
 use lib ('/home/sites/prog/www/Module');
 
 Both should work.
 
 José.
 
 -Original Message-
 From: awarsd [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 24, 2003 11:52 AM
 To: [EMAIL PROTECTED]
 Subject: installing module
 
 
 Hi,
 
 I would like to install Time::Hires
 so i have a path  in cgi script
 use lib '/home/sites/prog/www/Module';
 now inside the Module folder i created a new folder called Time inside that
 folder I put Hires.pm And the program says It can NOT found module
 
 Any help is appreciated
 

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



RE: installing module

2003-07-24 Thread NYIMI Jose (BMB)
Hum! Loadable object?

That's because perl is looking for HiRes.so which is
missing because you didn't install properly the module.

To install a module you should not just
create a folder and so forth ... as you did.

Better always to follow the

make
make test,
make install

In your case this will looks like:

1. tar xvf the .tar file and go to the folder where Makefile.PL is located.
2. /path_of_your_perl/bin/perl Makefile.PL PREFIX=/home/sites/prog/www/Module
3. make
4. make test
5. make install

Then try:

use lib qw(/home/sites/prog/www/Module/lib); #note the lib after Module
use Time::HiRes;

HTH,

José.

-Original Message-
From: awarsd [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 24, 2003 2:04 PM
To: [EMAIL PROTECTED]
Subject: Re: installing module


Hi,

I tried both ways and no luck:-( still give me same error:

Can't locate loadable object for module Time::HiRes in @INC (@INC contains: 
/home/sites/prog/www/Module /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 
/usr/lib/perl5/site_perl/5.6.1/i386-linux
/usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0/i386-linux
/usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at search.pl line 14

Anthony


Nyimi Jose [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
The SYNOPSIS of lib module is:
use lib LIST

The LIST stuff is important (LIST != EXPR).

So try:
use lib qw(/home/sites/prog/www/Module);
#or
use lib ('/home/sites/prog/www/Module');

Both should work.

José.

-Original Message-
From: awarsd [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 11:52 AM
To: [EMAIL PROTECTED]
Subject: installing module


Hi,

I would like to install Time::Hires
so i have a path  in cgi script
use lib '/home/sites/prog/www/Module';
now inside the Module folder i created a new folder called Time inside that folder I 
put Hires.pm And the program says It can NOT found module

Any help is appreciated



-- 
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]


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



Re: installing module

2003-07-24 Thread awarsd
Hi,

The Hires.pm typo is because i missed typed it here.
Anyways, the only problem is that it is on a website so i guess i have to
contact the Administrator

Thanx
Anthony



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



Checking for a directory

2003-07-24 Thread Rus Foster
Hi All,
Just trying to work out the code to test if a path is a directory or file.
Looked over the stat function but doesn't quite seem right. Can someone
give me a clue

thanks

Rus

-- 
www: http://jvds.com   | Virtual Servers from just $15/mo
MSNM: [EMAIL PROTECTED] | Totally Customizable Technology
e: [EMAIL PROTECTED]   | FreeBSD  Linux
   10% donation to FreeBSD.org on each purchase

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



RE: Checking for a directory

2003-07-24 Thread Marcos . Rebelo
Example Name Result 
-e $a   ExistsTrue if file named in $a exists 
-r $a   Readable  True if file named in $a is readable 
-w $a   Writable  True if file named in $a is writable 
-d $a   Directory True if file named in $a is a directory 
-f $a   File  True if file named in $a is a regular file 
-T $a   Text File True if file named in $a is a text file 

so:
if (-d $filename) {
print '$filename$ is a directory\n;
}





-Original Message-
From: Rus Foster [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 2:39 PM
To: [EMAIL PROTECTED]
Subject: Checking for a directory


Hi All,
Just trying to work out the code to test if a path is a directory or file.
Looked over the stat function but doesn't quite seem right. Can someone
give me a clue

thanks

Rus

-- 
www: http://jvds.com   | Virtual Servers from just $15/mo
MSNM: [EMAIL PROTECTED] | Totally Customizable Technology
e: [EMAIL PROTECTED]   | FreeBSD  Linux
   10% donation to FreeBSD.org on each purchase

-- 
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: Checking for a directory

2003-07-24 Thread LI NGOK LAM
if ( -d $path ) { print Directory }
elsif ( -f $path ) { print File }
else { print Not exist }

HTH

- Original Message - 
From: Rus Foster [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 8:39 PM
Subject: Checking for a directory


 Hi All,
 Just trying to work out the code to test if a path is a directory or file.
 Looked over the stat function but doesn't quite seem right. Can someone
 give me a clue

 thanks

 Rus

 -- 
 www: http://jvds.com   | Virtual Servers from just $15/mo
 MSNM: [EMAIL PROTECTED] | Totally Customizable Technology
 e: [EMAIL PROTECTED]   | FreeBSD  Linux
10% donation to FreeBSD.org on each purchase

 -- 
 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: Comparing 2 lists

2003-07-24 Thread Mike Flannigan

 Subject: Re: Comparing 2 lists
 Date: Mon, 21 Jul 2003 10:40:25 -0400 (EDT)
 From: Jeff 'japhy' Pinyan [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 CC: [EMAIL PROTECTED]

 This is in the FAQ -- if you type 'perldoc -q intersection', you'll
get an
 answer from the FAQ about finding the intersection of two arrays.

Newbie here.
I'm trying to experiment with this code in FAQ4.

I'd like to fix line 12 of this code first:

use strict;
use warnings;

my @array1 = (a,b,c,d,e,f,g);
my @array2 = (h,b,'c',i,j,k,g);

my @union = my @intersection = my @difference = ();
my %count = ();
foreach my $element (@array1, @array2) { $count{$element}++ }
foreach my $element (keys %count) {
push my (@union, $element);
push my (@{ $count{$element}  1 ? [EMAIL PROTECTED] : [EMAIL PROTECTED]
}), $element;
#THIS IS LINE 12
}

print @intersection,\n\n\n;
print @difference,\n\n\n;
print @union,\n\n\n;

# another print statment telling the reader what to do next
print Press ENTER to continue...;

# Perl waits at these brackets for user input



There is apparently something wrong with:
push my (@{ $count{$element}  1 ? [EMAIL PROTECTED] : [EMAIL PROTECTED] }),
$element;

It gives the warning or error of:
Use of uninitialized value in numeric gt () at compare.pl line 12.

After I fix this simple? problem, then I need to understand the
code and get it to work right  :-)


Mike Flannigan



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



RE: Checking for a directory

2003-07-24 Thread Kipp, James
-d $dir #if true than is a dir
-f $file #if true than is a regulare file



 -Original Message-
 From: Rus Foster [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 24, 2003 8:39 AM
 To: [EMAIL PROTECTED]
 Subject: Checking for a directory
 
 
 Hi All,
 Just trying to work out the code to test if a path is a 
 directory or file.
 Looked over the stat function but doesn't quite seem right. 
 Can someone
 give me a clue
 
 thanks
 
 Rus
 
 -- 
 www: http://jvds.com   | Virtual Servers from just $15/mo
 MSNM: [EMAIL PROTECTED] | Totally Customizable Technology
 e: [EMAIL PROTECTED]   | FreeBSD  Linux
10% donation to FreeBSD.org on each purchase
 
 -- 
 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: Checking for a directory

2003-07-24 Thread Dan Muey
 Hi All,
 Just trying to work out the code to test if a path is a 
 directory or file. Looked over the stat function but doesn't 
 quite seem right. Can someone give me a clue
 
Sure thing:

 if(-d $path) { print $path is adirectory; }
 perldoc -f -d to find out more about file tests

HTH
Dmuey

 thanks
 
 Rus
 
 -- 
 www: http://jvds.com   | Virtual Servers from just $15/mo
 MSNM: [EMAIL PROTECTED] | Totally Customizable Technology
 e: [EMAIL PROTECTED]   | FreeBSD  Linux
10% donation to FreeBSD.org on each purchase
 
 -- 
 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: Checking for a directory

2003-07-24 Thread wiggins


On Thu, 24 Jul 2003 23:00:17 +0800, LI NGOK LAM [EMAIL PROTECTED] wrote:

 if ( -d $path ) { print Directory }
 elsif ( -f $path ) { print File }
 else { print Not exist }
 

Not exist is misleading, just because a file is not a 'plain' file or a 'directory' 
does *NOT* indicate non-existence.  Existence should be checked explicitly with the -e 
operator. 

http://danconia.org

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



Re: Checking for a directory

2003-07-24 Thread LI NGOK LAM
Yep ! =)

Even though I can't imagine what a path is not file or directory would imply
more then not exist. But I agree to check the existence for a path by -e
is the safest operation.


- Original Message - 
From: [EMAIL PROTECTED]
To: LI NGOK LAM [EMAIL PROTECTED]; Rus Foster [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 11:06 PM
Subject: Re: Checking for a directory



 
 On Thu, 24 Jul 2003 23:00:17 +0800, LI NGOK LAM [EMAIL PROTECTED] wrote:

  if ( -d $path ) { print Directory }
  elsif ( -f $path ) { print File }
  else { print Not exist }
 

 Not exist is misleading, just because a file is not a 'plain' file or a
'directory' does *NOT* indicate non-existence.  Existence should be checked
explicitly with the -e operator.

 http://danconia.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: Checking for a directory

2003-07-24 Thread Rus Foster
On Thu, 24 Jul 2003, LI NGOK LAM wrote:

 if ( -d $path ) { print Directory }
 elsif ( -f $path ) { print File }
 else { print Not exist }

 HTH

Cheers all. Think I was trying to be to clever for my own good

RGds

]Rus
-- 
www: http://jvds.com   | Virtual Servers from just $15/mo
MSNM: [EMAIL PROTECTED] | Totally Customizable Technology
e: [EMAIL PROTECTED]   | FreeBSD  Linux
   10% donation to FreeBSD.org on each purchase

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



RE: perl program

2003-07-24 Thread Kogulan, Reggie
I am newbie here. I want to know if the perl program code can be protected such that 
noone else sees it. In other words,I have several perl codes and want to know if I can 
put out a file only as executable such that the code cannot be seen.

Thanks
Reggie


-Original Message-
From: Rus Foster [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 10:03 AM
To: LI NGOK LAM
Cc: [EMAIL PROTECTED]
Subject: Re: Checking for a directory


On Thu, 24 Jul 2003, LI NGOK LAM wrote:

 if ( -d $path ) { print Directory }
 elsif ( -f $path ) { print File }
 else { print Not exist }

 HTH

Cheers all. Think I was trying to be to clever for my own good

RGds

]Rus
-- 
www: http://jvds.com   | Virtual Servers from just $15/mo
MSNM: [EMAIL PROTECTED] | Totally Customizable Technology
e: [EMAIL PROTECTED]   | FreeBSD  Linux
   10% donation to FreeBSD.org on each purchase

-- 
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]



Perl + Oracle + Blobs + PDFs - Dumping to filesystem

2003-07-24 Thread Levon Barker
Hello List!

Have a quick question that I am sure someone knows the answer to. I
switching from handling long raw data in Oracle to only storing a pointer to
the file on the file system. I am dealing mostly with PDFs.

The process seems/ed pretty easy: select the contents of the longvar column
into a perl variable and then save it to the file system.
So I do something like this:

while ($sth-fetch()) {
open FH, $binObjId.pdf;
print FH, $contents;
close FH;
}

That almost works.

After this runs on a coulple of files, I try to open one, and the PDF
reports that the file is damaged and also none of the jpgs that were
embedded in the PDF show up. Acrobat tells me that there is insufficient
data to display the image.

So I am guessing that 'print FH, $contents' is a bad way to get the pdf to
the file system.

Any thoughts?

Thanks in advance,
Levon Barker


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



HTH

2003-07-24 Thread Jeff Westman
Hi,

Okay guys, what does this mean?  Several of you 'sign' with this.

HTH (lol)

JW

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: HTH

2003-07-24 Thread George Schlossnagle
Hope That Helps

(Laugh Out Loud)

On Thursday, July 24, 2003, at 11:32  AM, Jeff Westman wrote:

Hi,

Okay guys, what does this mean?  Several of you 'sign' with this.

HTH (lol)



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


RE: HTH

2003-07-24 Thread Bob Showalter
Jeff Westman wrote:
 Hi,
 
 Okay guys, what does this mean?  Several of you 'sign' with this.
 
 HTH (lol)

Hope That Helps

HTH :~)

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



RE: perl program

2003-07-24 Thread Levon Barker
Hi Reggie,

You may want to glance at the archives for the answer to this question. I
know its been discussed before.

Take a look at perlcc and ActiveState's perldev kit. I believe, however,
there is no perfect solution to this. Usually, the best way to do this is
write the portions of your code that you want to hide in C and leave the
rest exposed in perl.

BTW, this line of questioning is going to get some interesting discussion as
to the morality of 'hiding' your perl code.

Cheers,
Levon Barker

 -Original Message-
 From: Kogulan, Reggie [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 24, 2003 11:27 AM
 To: Rus Foster; LI NGOK LAM
 Cc: [EMAIL PROTECTED]
 Subject: RE: perl program


 I am newbie here. I want to know if the perl program code can be
 protected such that noone else sees it. In other words,I have
 several perl codes and want to know if I can put out a file only
 as executable such that the code cannot be seen.

 Thanks
 Reggie


 -Original Message-
 From: Rus Foster [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 24, 2003 10:03 AM
 To: LI NGOK LAM
 Cc: [EMAIL PROTECTED]
 Subject: Re: Checking for a directory
 
 
 On Thu, 24 Jul 2003, LI NGOK LAM wrote:
 
  if ( -d $path ) { print Directory }
  elsif ( -f $path ) { print File }
  else { print Not exist }
 
  HTH
 
 Cheers all. Think I was trying to be to clever for my own good
 
 RGds
 
 ]Rus
 --
 www: http://jvds.com   | Virtual Servers from just $15/mo
 MSNM: [EMAIL PROTECTED] | Totally Customizable Technology
 e: [EMAIL PROTECTED]   | FreeBSD  Linux
10% donation to FreeBSD.org on each purchase
 
 --
 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 + Oracle + Blobs + PDFs - Dumping to filesystem

2003-07-24 Thread Steve Mayer
Levon,

  You might try using the binmode function on your filehandle:

open FH, $binObjId.pdf;
binmode FH;
print FH, $contents;
close FH;


Steve

On Thu, Jul 24, 2003 at 11:26:52AM -0400, Levon Barker wrote:
 Hello List!
 
 Have a quick question that I am sure someone knows the answer to. I
 switching from handling long raw data in Oracle to only storing a pointer to
 the file on the file system. I am dealing mostly with PDFs.
 
 The process seems/ed pretty easy: select the contents of the longvar column
 into a perl variable and then save it to the file system.
 So I do something like this:
 
 while ($sth-fetch()) {
 open FH, $binObjId.pdf;
 print FH, $contents;
 close FH;
 }
 
 That almost works.
 
 After this runs on a coulple of files, I try to open one, and the PDF
 reports that the file is damaged and also none of the jpgs that were
 embedded in the PDF show up. Acrobat tells me that there is insufficient
 data to display the image.
 
 So I am guessing that 'print FH, $contents' is a bad way to get the pdf to
 the file system.
 
 Any thoughts?
 
 Thanks in advance,
 Levon Barker
 
 
 -- 
 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 + Oracle + Blobs + PDFs - Dumping to filesystem

2003-07-24 Thread Levon Barker
Thanks Steve,

That was the solution.

Cheers,
Levon Barker

 -Original Message-
 From: Steve Mayer [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 24, 2003 11:41 AM
 To: Levon Barker
 Cc: [EMAIL PROTECTED]
 Subject: Re: Perl + Oracle + Blobs + PDFs - Dumping to filesystem


 Levon,

   You might try using the binmode function on your filehandle:

 open FH, $binObjId.pdf;
 binmode FH;
 print FH, $contents;
 close FH;


 Steve

 On Thu, Jul 24, 2003 at 11:26:52AM -0400, Levon Barker wrote:
  Hello List!
 
  Have a quick question that I am sure someone knows the answer to. I
  switching from handling long raw data in Oracle to only storing
 a pointer to
  the file on the file system. I am dealing mostly with PDFs.
 
  The process seems/ed pretty easy: select the contents of the
 longvar column
  into a perl variable and then save it to the file system.
  So I do something like this:
 
  while ($sth-fetch()) {
  open FH, $binObjId.pdf;
  print FH, $contents;
  close FH;
  }
 
  That almost works.
 
  After this runs on a coulple of files, I try to open one, and the PDF
  reports that the file is damaged and also none of the jpgs that were
  embedded in the PDF show up. Acrobat tells me that there is insufficient
  data to display the image.
 
  So I am guessing that 'print FH, $contents' is a bad way to get
 the pdf to
  the file system.
 
  Any thoughts?
 
  Thanks in advance,
  Levon Barker
 
 
  --
  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 + Oracle + Blobs + PDFs - Dumping to filesystem

2003-07-24 Thread Dan Muey
 while ($sth-fetch()) {
 open FH, $binObjId.pdf;
 print FH, $contents;
 close FH;
 }
 
 That almost works.
 
 After this runs on a coulple of files, I try to open one, and 
 the PDF reports that the file is damaged and also none of the 
 jpgs that were embedded in the PDF show up. Acrobat tells me 
 that there is insufficient data to display the image.
 
 So I am guessing that 'print FH, $contents' is a bad way to 
 get the pdf to the file system.


You need to writre it in binary mode:

open FH ... 
binmode FH;
print FH ..

perldoc -f binmode

HTH

DMuey

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



Re: Comparing 2 lists

2003-07-24 Thread John W. Krahn
Mike Flannigan wrote:
 
 Newbie here.
 I'm trying to experiment with this code in FAQ4.
 
 I'd like to fix line 12 of this code first:
 
 use strict;
 use warnings;
 
 my @array1 = (a,b,c,d,e,f,g);
 my @array2 = (h,b,'c',i,j,k,g);
 
 my @union = my @intersection = my @difference = ();
 my %count = ();
 foreach my $element (@array1, @array2) { $count{$element}++ }
 foreach my $element (keys %count) {
 push my (@union, $element);
   ^^
 push my (@{ $count{$element}  1 ? [EMAIL PROTECTED] : [EMAIL PROTECTED]
   ^^
 }), $element;

Remove the my() function and it will work.

push @union, $element;
push @{ $count{$element}  1 ? [EMAIL PROTECTED] : [EMAIL PROTECTED] },
$element;


 #THIS IS LINE 12
 }


John
-- 
use Perl;
program
fulfillment

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



RE: Perl + Oracle + Blobs + PDFs - Dumping to filesystem

2003-07-24 Thread Levon Barker
Thanks for the quick response Dan, that solution is correct, but Steve beat
you to the punch. :)

 -Original Message-
 From: Dan Muey [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 24, 2003 11:35 AM
 To: Levon Barker; [EMAIL PROTECTED]
 Subject: RE: Perl + Oracle + Blobs + PDFs - Dumping to filesystem


  while ($sth-fetch()) {
  open FH, $binObjId.pdf;
  print FH, $contents;
  close FH;
  }
 
  That almost works.
 
  After this runs on a coulple of files, I try to open one, and
  the PDF reports that the file is damaged and also none of the
  jpgs that were embedded in the PDF show up. Acrobat tells me
  that there is insufficient data to display the image.
 
  So I am guessing that 'print FH, $contents' is a bad way to
  get the pdf to the file system.
 

 You need to writre it in binary mode:

 open FH ...
 binmode FH;
 print FH ..

 perldoc -f binmode

 HTH

 DMuey

 --
 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: HTH

2003-07-24 Thread Rus Foster
On Thu, 24 Jul 2003, Jeff Westman wrote:

 Hi,

 Okay guys, what does this mean?  Several of you 'sign' with this.

 HTH (lol)


Hope That Helps

HTH :)

Rus
--
www: http://jvds.com   | Virtual Servers from just $15/mo
MSNM: [EMAIL PROTECTED] | Totally Customizable Technology
e: [EMAIL PROTECTED]   | FreeBSD  Linux
   10% donation to FreeBSD.org on each purchase


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



Re: Perl + Oracle + Blobs + PDFs - Dumping to filesystem

2003-07-24 Thread Steve Mayer
Levon,

  Great!  Glad that worked out.

Steve

On Thu, Jul 24, 2003 at 11:39:58AM -0400, Levon Barker wrote:
 Thanks Steve,
 
 That was the solution.
 
 Cheers,
 Levon Barker
 
  -Original Message-
  From: Steve Mayer [mailto:[EMAIL PROTECTED]
  Sent: Thursday, July 24, 2003 11:41 AM
  To: Levon Barker
  Cc: [EMAIL PROTECTED]
  Subject: Re: Perl + Oracle + Blobs + PDFs - Dumping to filesystem
 
 
  Levon,
 
You might try using the binmode function on your filehandle:
 
  open FH, $binObjId.pdf;
  binmode FH;
  print FH, $contents;
  close FH;
 
 
  Steve
 
  On Thu, Jul 24, 2003 at 11:26:52AM -0400, Levon Barker wrote:
   Hello List!
  
   Have a quick question that I am sure someone knows the answer to. I
   switching from handling long raw data in Oracle to only storing
  a pointer to
   the file on the file system. I am dealing mostly with PDFs.
  
   The process seems/ed pretty easy: select the contents of the
  longvar column
   into a perl variable and then save it to the file system.
   So I do something like this:
  
   while ($sth-fetch()) {
   open FH, $binObjId.pdf;
   print FH, $contents;
   close FH;
   }
  
   That almost works.
  
   After this runs on a coulple of files, I try to open one, and the PDF
   reports that the file is damaged and also none of the jpgs that were
   embedded in the PDF show up. Acrobat tells me that there is insufficient
   data to display the image.
  
   So I am guessing that 'print FH, $contents' is a bad way to get
  the pdf to
   the file system.
  
   Any thoughts?
  
   Thanks in advance,
   Levon Barker
  
  
   --
   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]
 
 
=
Steve Mayer Oracle Corporation
Project Lead1211 SW 5th Ave.
Portland Development Center Suite 900
[EMAIL PROTECTED]   Portland, OR 97204 
Phone:  503-525-3127
=

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



Kinda Perl

2003-07-24 Thread bseel
I have been writing perl along with some other languages, and I have been thinking 
about setting up a server (so that I can play with different server OS's and settings 
without messing anything up on our home network). My parents think that it will cost 
to much in power. I was just wondering if anyone knows about how much it is per day to 
run a computer without a monitor.

Brian Seel
High School Intern
Micron Technology
[EMAIL PROTECTED]



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



HTH

2003-07-24 Thread bseel
Scary, those last two responses were almost identical. You two have been on this list 
way to long I see ;)

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



RE: HTH

2003-07-24 Thread Dan Muey
I always thought that it'd fit : How's That Hang? :) as in Does that do what you 
are needing?

Not really just thought I'd toss that out there!

 -Original Message-
 From: Bob Showalter [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, July 24, 2003 10:34 AM
 To: 'Jeff Westman'; beginners
 Subject: RE: HTH
 
 
 Jeff Westman wrote:
  Hi,
  
  Okay guys, what does this mean?  Several of you 'sign' with this.
  
  HTH (lol)
 
 Hope That Helps
 
 HTH :~)
 
 -- 
 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 + Oracle + Blobs + PDFs - Dumping to filesystem

2003-07-24 Thread Dan Muey
 Thanks for the quick response Dan, that solution is correct, 
 but Steve beat you to the punch. :)

Dang! I'll get you next time Steve, NEXT TIME ;p

 
  -Original Message-
  From: Dan Muey [mailto:[EMAIL PROTECTED]
  Sent: Thursday, July 24, 2003 11:35 AM
  To: Levon Barker; [EMAIL PROTECTED]
  Subject: RE: Perl + Oracle + Blobs + PDFs - Dumping to filesystem
 
 
   while ($sth-fetch()) {
   open FH, $binObjId.pdf;
   print FH, $contents;
   close FH;
   }
  
   That almost works.
  
   After this runs on a coulple of files, I try to open one, and the 
   PDF reports that the file is damaged and also none of the 
 jpgs that 
   were embedded in the PDF show up. Acrobat tells me that there is 
   insufficient data to display the image.
  
   So I am guessing that 'print FH, $contents' is a bad way 
 to get the 
   pdf to the file system.
  
 
  You need to writre it in binary mode:
 
  open FH ...
  binmode FH;
  print FH ..
 
  perldoc -f binmode
 
  HTH
 
  DMuey
 
  --
  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: Checking for a directory

2003-07-24 Thread wiggins

On Thu, 24 Jul 2003 23:20:20 +0800, LI NGOK LAM [EMAIL PROTECTED] wrote:

 Yep ! =)
 
 Even though I can't imagine what a path is not file or directory would imply
 more then not exist. But I agree to check the existence for a path by -e
 is the safest operation.
 

Since you asked ;-) from perldoc -f -e 

-l  File is a symbolic link.
-p  File is a named pipe (FIFO), or Filehandle is a pipe.
-S  File is a socket.
-b  File is a block special file.
-c  File is a character special file.

-f implies that a file is 'plain' aka not really special in any way. Files come in 
many different flavors not only based on their contents, though this is largely system 
dependent. Most windows and old Mac OS users will go their whole life not knowing 
about these (I said not knowing about and most, not that they don't exist there, 
personally I am not sure they do or don't, but then I don't much care either :-) )...

If you have access to a fairly standard unix system try:

perl -e 'if (-f /dev/tty0) { print File is plain.\n; } else { if (-e /dev/tty0) 
{ print File is not plain, but does exist.\n } }'

The issue was not with whether -f will tell you of non-existence, because it will, but 
by using your 'else' block you were implying non-existence by not being a plain file 
and not a directory, which is an incorrect (strictly speaking) implication.

http://danconia.org

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



Re: HTH

2003-07-24 Thread Gary Stainburn
On Thursday 24 Jul 2003 4:46 pm, Dan Muey wrote:
 I always thought that it'd fit : How's That Hang? :) as in Does that do
 what you are needing?

 Not really just thought I'd toss that out there!

yeah, and I thought LOL was lots of laughs


  -Original Message-
  From: Bob Showalter [mailto:[EMAIL PROTECTED]
  Sent: Thursday, July 24, 2003 10:34 AM
  To: 'Jeff Westman'; beginners
  Subject: RE: HTH
 
  Jeff Westman wrote:
   Hi,
  
   Okay guys, what does this mean?  Several of you 'sign' with this.
  
   HTH (lol)
 
  Hope That Helps
 
  HTH :~)
 
  --
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 


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



RE: HTH

2003-07-24 Thread wiggins


On Thu, 24 Jul 2003 08:32:27 -0700 (PDT), Jeff Westman [EMAIL PROTECTED] wrote:

 Hi,
 
 Okay guys, what does this mean?  Several of you 'sign' with this.
 
 HTH (lol)
 

Or when used at the top of a posting, Hope This Helps as opposed to the bottom That 
Helped

For those uninitiated if you ever see a term similar to this that you don't understand 
have a look here

http://info.astrian.net/jargon/terms/h.html#HTH

HAND,

http://danconia.org

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



Simple text email via Mail::Sender and I screwed it up somehow!

2003-07-24 Thread Dan Muey
Howdy all, 

I'm trying to test a simple plain email sending bit of code. 
When I run the script below I get this:
... Error sending mail: 
Perl-  : 
Module- Connection not established

I can do this via Net::SMTP and all is well (OUTPUT FORM IT BELOW _Net:SMTP_)
I know Mail::Sender can send mail at the server because I have a scirpt that attaches 
a pdf file and mails it away and that is going peachy as well.

I'm assuming I'm not doing the Mail::Sender thibg wrong but the only 
differences I can think of between what is below and the one that works are:
1) The variable aren't double quoted
2) I removed the section that adds the pdf 

What am I completely and utterly missing /doing wrong?

TIA
Dan

-
#!/usr/bin/perl -w

use strict;
use Mail::Sender;

my $smtp = 'ip of mailserver this script is on';
my $subj = 'mail sender test';
my $admn = '[EMAIL PROTECTED]';
my $body = 'HOWDY';

eval {
my $sender = new Mail::Sender {smtp = $smtp, from = $admn,to = 
$admn, subject = $subj};
$sender-Body({
ctype = 'text/plain', 
msg = $body
});
$sender-Close();
};
if($@ || $Mail::Sender::Error) { 
print ... Error sending mail: \nPerl- $@ : \nModule- 
$Mail::Sender::Error \n; 
  } else { print Sent ok to $admn $Mail::Sender::Error \n; }
--
_Net::SMTP_

DEBUG CODE :

Net::SMTP: Net::SMTP(2.22)
Net::SMTP:   Net::Cmd(2.21)
Net::SMTP: Exporter
Net::SMTP:   IO::Socket::INET
Net::SMTP: IO::Socket(1.1603)
Net::SMTP:   IO::Handle(1.1505)

Net::SMTP=GLOB(0x80578a8) 220 q42.infiniplex.net ESMTP
Net::SMTP=GLOB(0x80578a8) EHLO localhost.localdomain
Net::SMTP=GLOB(0x80578a8) 250-q42.infiniplex.net
Net::SMTP=GLOB(0x80578a8) 250-PIPELINING
Net::SMTP=GLOB(0x80578a8) 250 8BITMIME
Net::SMTP=GLOB(0x80578a8) MAIL FROM:[EMAIL PROTECTED]
Net::SMTP=GLOB(0x80578a8) 250 ok
Net::SMTP=GLOB(0x80578a8) RCPT TO:[EMAIL PROTECTED]
Net::SMTP=GLOB(0x80578a8) 250 ok
Net::SMTP=GLOB(0x80578a8) DATA
Net::SMTP=GLOB(0x80578a8) 354 go ahead
Net::SMTP=GLOB(0x80578a8) To:  [EMAIL PROTECTED]
Net::SMTP=GLOB(0x80578a8) From: [EMAIL PROTECTED]
Net::SMTP=GLOB(0x80578a8) Subject: Quit talking to yourself -
Net::SMTP=GLOB(0x80578a8) 
Net::SMTP=GLOB(0x80578a8) Look at who this is from. Did you really send this to 
yourself? I think not!

Net::SMTP=GLOB(0x80578a8) .
Net::SMTP=GLOB(0x80578a8) 250 ok 1059062370 qp 35700
Net::SMTP=GLOB(0x80578a8) QUIT
Net::SMTP=GLOB(0x80578a8) 221 q42.infiniplex.net

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



RE: HTH

2003-07-24 Thread Dan Muey

 On Thursday 24 Jul 2003 4:46 pm, Dan Muey wrote:
  I always thought that it'd fit : How's That Hang? :) as in Does 
  that do what you are needing?
 
  Not really just thought I'd toss that out there!
 
 yeah, and I thought LOL was lots of laughs

I wonder is there an official tech slang acronym site?

TIA (Thanks In Advance)

 
 
   -Original Message-
   From: Bob Showalter [mailto:[EMAIL PROTECTED]
   Sent: Thursday, July 24, 2003 10:34 AM
   To: 'Jeff Westman'; beginners
   Subject: RE: HTH
  
   Jeff Westman wrote:
Hi,
   
Okay guys, what does this mean?  Several of you 'sign' 
 with this.
   
HTH (lol)
  
   Hope That Helps
  
   HTH :~)
  
   --
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 -- 
 Gary Stainburn
  
 This email does not contain private or confidential material 
 as it may be snooped on by interested government parties for unknown
 and undisclosed purposes - Regulation of Investigatory Powers 
 Act, 2000 
 
 

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



RE: HTH

2003-07-24 Thread bseel
Official slang?? I don't think that exists. I have a friend who just makes up acronyms 
on the fly and no one has any idea what it means (I believe that there are a lot of 
those type of people out there). Probably there are guides, but no official slang 
sites. :P

Brian


 On Thursday 24 Jul 2003 4:46 pm, Dan Muey wrote:
  I always thought that it'd fit : How's That Hang? :) as in Does 
  that do what you are needing?
 
  Not really just thought I'd toss that out there!
 
 yeah, and I thought LOL was lots of laughs

I wonder is there an official tech slang acronym site?

TIA (Thanks In Advance)

 
 
   -Original Message-
   From: Bob Showalter [mailto:[EMAIL PROTECTED]
   Sent: Thursday, July 24, 2003 10:34 AM
   To: 'Jeff Westman'; beginners
   Subject: RE: HTH
  
   Jeff Westman wrote:
Hi,
   
Okay guys, what does this mean?  Several of you 'sign' 
 with this.
   
HTH (lol)
  
   Hope That Helps
  
   HTH :~)
  
   --
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 -- 
 Gary Stainburn
  
 This email does not contain private or confidential material 
 as it may be snooped on by interested government parties for unknown
 and undisclosed purposes - Regulation of Investigatory Powers 
 Act, 2000 
 
 

-- 
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]



ftp URI with absolute path

2003-07-24 Thread Joshua Colson
I have a question that is probably stupid.

I'm trying to create a ftp URI object with an absolute path.
I would like to be able to use Net::FTP to connect to a host, and then
use the $uri-path() (or similar) to determine if the file is located
off of the root directory or a subdirectory of the users home.

$uri-path() returns a string that always begins with '/'. I've found
that I can embed the escaped slash '/' with the string '%2F' but I don't
think that it a very elegant solution. Also $uri-path() doesn't parse
it. It just sees it as the literal string.

Well, if anyone has any idea's I would appreciate any help I can get.

Thanks.

Joshua Colson


signature.asc
Description: This is a digitally signed message part


Re: Comparing 2 lists

2003-07-24 Thread Mike Flannigan

Shiping Wang wrote:

 ###

  foreach my $element (keys %count) {
  push @union, $element;
  push @{ $count{$element}  1 ? [EMAIL PROTECTED] : [EMAIL PROTECTED] },
 $element;

  }   # you have declared my for @union, @intersection and @difference above
 ###

Thank you Mr. Wang.  That change worked perfectly.
It's incredible how well that script works.  I guess I got
in trouble by jumping too far forward with my my's :-)

Now I should be able to figure out how it works with
only a few hours of work, or less.

Also, I get the digest version of this list, so I won't see
many other responses that have probably already been
posted until later.

The final script is:
use strict;
use warnings;

my @array1 = (a,b,c,d,e,f,g);
my @array2 = (h,b,'c',i,j,k,g);

my @union = my @intersection = my @difference = ();
my %count = ();
foreach my $element (@array1, @array2) { $count{$element}++ }
foreach my $element (keys %count) {
push @union, $element;
push @{ $count{$element}  1 ? [EMAIL PROTECTED] : [EMAIL PROTECTED] }, 
$element;
}

print @intersection,\n\n\n;
print @difference,\n\n\n;
print @union,\n\n\n;

# another print statment telling the reader what to do next
print Press ENTER to continue...;

# Perl waits at these brackets for user input



Mike



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



RE: Simple text email via Mail::Sender and I screwed it up somehow!

2003-07-24 Thread Dan Muey
Ok I'm, an idiot:

In the eval it has to be :   
my $sender = new Mail::Sender {smtp = $smtp, from = $admn};
$sender-Open({
to = $admn,
subject = $subj
});
$sender-SendLineEnc($body);
$sender-Close();]
The Body function is for multipart messages.
Sorry for the inconvenience.

Dan


 
 eval {
 my $sender = new Mail::Sender {smtp = $smtp, 
 from = $admn,to = $admn, subject = $subj};
 $sender-Body({
 ctype = 'text/plain', 
 msg = $body
 });
 $sender-Close();
 };
 if($@ || $Mail::Sender::Error) { 
   print ... Error sending mail: \nPerl- $@ : 
 \nModule- $Mail::Sender::Error \n; 
 } else { print Sent ok to $admn $Mail::Sender::Error \n; }

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



RE: HTH

2003-07-24 Thread Bob Showalter
Dan Muey wrote:
  On Thursday 24 Jul 2003 4:46 pm, Dan Muey wrote:
   I always thought that it'd fit : How's That Hang? :) as in Does
   that do what you are needing?
   
   Not really just thought I'd toss that out there!
  
  yeah, and I thought LOL was lots of laughs
 
 I wonder is there an official tech slang acronym site?

Maybe not official, but...

http://www.acronymfinder.com/


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



RE: comparing more than one list

2003-07-24 Thread Mark Anderson


 Hi to [EMAIL PROTECTED] This is my first posting so please be gentle.
 I've followed the comparing two lists thread with interest. What I'd like
 to do is to compare 16 lists to see whether each of the entries in e.g.
 list 1 is present in one or more of the other 15. Each entry in the list
 consists of a position, a string and a score. I would like to compare just
 the position/strings for presence/absence in other lists.
 Any ideas?

Since you followed the comparing two lists thread, and since you just asked
for ideas:

Read in List 1, and add each line to a hash (list1hash).

Forevery other list, read in each line and if it exists in list1hash, add
it to a different hash (existshash).

When you're done, you have a hash of elements from list 1 that occur in
another list in existshash.  You can then iterate through the keys of
list1hash, and test each for existence in existshash.  If a key from
list1hash doesn't exist in existshash, then you can either print it
as absent or add it to yet another hash (absencehash).

HTH (I always thought it was Hope This Helps, even at the end),
/\/\ark


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



RE: HTH

2003-07-24 Thread bseel
Funny how such a simple question got so many responses.

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



RE: HTH

2003-07-24 Thread Ned Cunningham
tmtowtdi


Ned Cunningham
POS Systems Developer
Monro Muffler Brake  Service
200 Holleder Parkway
Rochester, New York 14615
 (585) 647-6400 ext 310
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 



-Original Message-
From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent:   Thursday, July 24, 2003 12:52 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject:RE: HTH

Funny how such a simple question got so many responses.

-- 
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: HTH

2003-07-24 Thread bseel
ROTFLMAO, TTYL, CYA

-Original Message-
From: Ned Cunningham [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 10:54 AM
To: bseel [CONTRACTOR]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: HTH


tmtowtdi


Ned Cunningham
POS Systems Developer
Monro Muffler Brake  Service
200 Holleder Parkway
Rochester, New York 14615
 (585) 647-6400 ext 310
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 



-Original Message-
From:   [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent:   Thursday, July 24, 2003 12:52 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject:RE: HTH

Funny how such a simple question got so many responses.

-- 
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 program

2003-07-24 Thread Aaron Christopher Vonderhaar

If you use a unix-like system and have some kind of priviledged access, you
could try: create a new user, say perlmaster

chown perlmaster script.pl
chmod 700 script.pl  # only perlmaster can run it
(echo #!/bin/sh; echo /path/to/script.pl)  run_the_script.sh
chown perlmaster run_the_script.sh
chmod 4777 run_the_script.sh

making run_the_script.sh setuid perlmaster, so it can run script.pl, but
no other users can access it.  Of course, script.pl then runs as perlmaster
which may not be what you want.  There are ways around this that are much much
uglier.  Personal recommendation is to free the source.

Aaron VonderHaar
([EMAIL PROTECTED])



 I am newbie here. I want to know if the perl program code can be =
 protected such that noone else sees it. In other words,I have several =
 perl codes and want to know if I can put out a file only as executable =
 such that the code cannot be seen.

 Thanks
 Reggie



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



for/foreach question

2003-07-24 Thread Peter Fleck
I just stumbled upon this in some perl I'm working on:

for $arrayref (@datedbi) {
   #do stuff
}
It didn't look right and sure enough, it should be 'foreach'.

But it worked fine and that's my question - why is this working?

@datedbi's elements are references to lists and they all seem to be 
getting processed the way I want whether I use 'for' or 'foreach' in 
the code.
--
Peter Fleck
Webmaster | University of Minnesota Cancer Center
Dinnaken Office Bldg.
925 Delaware St. SE
Minneapolis, MN  55414
612-625-8668 | [EMAIL PROTECTED] | www.cancer.umn.edu
Campus Mail: MMC 806

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


RE: perl program

2003-07-24 Thread Kogulan, Reggie
Aaron,
What I am looking is to distribute the executable only. Not the code. like a compiled 
C program will generates a.out or jar file in java. Thats all I am looking for.

Someone earlier said to use perlcc. Which I did now. I do not see an executable file.

example: $perlcc -o testfile test.pl

Did not produce testfile at all.
Is there something else I need to do?

Thanks in advance.

Reggie 


-Original Message-
From: Aaron Christopher Vonderhaar [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 11:58 AM
To: Kogulan, Reggie; [EMAIL PROTECTED]
Subject: Re: perl program



If you use a unix-like system and have some kind of 
priviledged access, you
could try: create a new user, say perlmaster

chown perlmaster script.pl
chmod 700 script.pl  # only perlmaster can run it
(echo #!/bin/sh; echo /path/to/script.pl)  run_the_script.sh
chown perlmaster run_the_script.sh
chmod 4777 run_the_script.sh

making run_the_script.sh setuid perlmaster, so it can run 
script.pl, but
no other users can access it.  Of course, script.pl then 
runs as perlmaster
which may not be what you want.  There are ways around this 
that are much much
uglier.  Personal recommendation is to free the source.

Aaron VonderHaar
([EMAIL PROTECTED])



 I am newbie here. I want to know if the perl program code can be =
 protected such that noone else sees it. In other words,I 
have several =
 perl codes and want to know if I can put out a file only 
as executable =
 such that the code cannot be seen.

 Thanks
 Reggie




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



Re: for/foreach question

2003-07-24 Thread Jeff 'japhy' Pinyan
On Jul 24, Peter Fleck said:

for $arrayref (@datedbi) {
#do stuff
}

It didn't look right and sure enough, it should be 'foreach'.

But it worked fine and that's my question - why is this working?

In Perl, 'for' and 'foreach' are the EXACT SAME THING.

  for $x (@list) ...
  foreach $x (@list) ...

  for ($x = 0; $x  10; $x++) ...
  foreach ($x = 0; $x = 10; $x++) ...

Each pair is identical.  I never use foreach... it's four extra
characters, and I think for works in both instances just fine.

-- 
Jeff japhy Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
stu what does y/// stand for?  tenderpuss why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


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



RE: HTH

2003-07-24 Thread Dan Muey
 
 ROTFLMAO, TTYL, CYA

Wait a sec isn't CYA not really an acronym?
It short for See you [later] right, or is it Curb your Attitude ?

Ok now that this is way OT any one have any perl issues?
(That's Off Topic just FYI, ok I'm stopping there)

 

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



Re: Checking for a directory

2003-07-24 Thread LI NGOK LAM
Thanks for this great lesson, I will take account for this on my furture =))


- Original Message - 
From: [EMAIL PROTECTED]
To: LI NGOK LAM [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, July 25, 2003 12:17 AM
Subject: Re: Checking for a directory


 
 On Thu, 24 Jul 2003 23:20:20 +0800, LI NGOK LAM [EMAIL PROTECTED] wrote:

  Yep ! =)
 
  Even though I can't imagine what a path is not file or directory would
imply
  more then not exist. But I agree to check the existence for a path by -e
  is the safest operation.
 

 Since you asked ;-) from perldoc -f -e 

 -l  File is a symbolic link.
 -p  File is a named pipe (FIFO), or Filehandle is a pipe.
 -S  File is a socket.
 -b  File is a block special file.
 -c  File is a character special file.

 -f implies that a file is 'plain' aka not really special in any way. Files
come in many different flavors not only based on their contents, though this
is largely system dependent. Most windows and old Mac OS users will go their
whole life not knowing about these (I said not knowing about and most,
not that they don't exist there, personally I am not sure they do or don't,
but then I don't much care either :-) )...

 If you have access to a fairly standard unix system try:

 perl -e 'if (-f /dev/tty0) { print File is plain.\n; } else { if (-e
/dev/tty0) { print File is not plain, but does exist.\n } }'

 The issue was not with whether -f will tell you of non-existence, because
it will, but by using your 'else' block you were implying non-existence by
not being a plain file and not a directory, which is an incorrect (strictly
speaking) implication.

 http://danconia.org




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



Re: for/foreach question

2003-07-24 Thread david
Peter Fleck wrote:

 I just stumbled upon this in some perl I'm working on:
 
 for $arrayref (@datedbi) {
 #do stuff
 }
 
 It didn't look right and sure enough, it should be 'foreach'.
 
 But it worked fine and that's my question - why is this working?
 
 @datedbi's elements are references to lists and they all seem to be
 getting processed the way I want whether I use 'for' or 'foreach' in
 the code.

Perl internally compiles 'for' into 'foreach' for you:

[panda]$ perl -MO=Deparse -e 'for $i (1..4){;}'
foreach $i (1 .. 4) {
();
}
-e syntax OK
[panda]$

they are exactly the same.

david

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



Re: HTH

2003-07-24 Thread John W. Krahn
[ Please do not top-post.  TIA ]


Dan Muey wrote:
 
  On Thursday 24 Jul 2003 4:46 pm, Dan Muey wrote:
   I always thought that it'd fit : How's That Hang? :) as in Does
   that do what you are needing?
  
   Not really just thought I'd toss that out there!
 
  yeah, and I thought LOL was lots of laughs
 
 I wonder is there an official tech slang acronym site?

This is probably as close as you are going to get:

http://catb.org/~esr/jargon/


John
-- 
use Perl;
program
fulfillment

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



Re: for/foreach question

2003-07-24 Thread awarsd
Hi,

I think it is good to have foreach and for loop
even tough they are the same
if you are searching in a file you can almost make a sentence
foreach $line(@infile) #-- to me this is more readable
than
for $line(@infile)
But for loop, I use it only for numbers
for(1..53) or for( $i=0;$i50;$i++);
it is also close to c++ so the transition from one language to another is
tiny bit easier.
This is my little point of view.

Anthony



David [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Peter Fleck wrote:

  I just stumbled upon this in some perl I'm working on:
 
  for $arrayref (@datedbi) {
  #do stuff
  }
 
  It didn't look right and sure enough, it should be 'foreach'.
 
  But it worked fine and that's my question - why is this working?
 
  @datedbi's elements are references to lists and they all seem to be
  getting processed the way I want whether I use 'for' or 'foreach' in
  the code.

 Perl internally compiles 'for' into 'foreach' for you:

 [panda]$ perl -MO=Deparse -e 'for $i (1..4){;}'
 foreach $i (1 .. 4) {
 ();
 }
 -e syntax OK
 [panda]$

 they are exactly the same.

 david



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



regarding CGI.pm---sorry for posting again

2003-07-24 Thread Visu
Hi,
I have a cgi code like the one below.when i run this program
i got the error message as premature end of script headers in my server's 
error log.I am new to this CGI module.

  use CGI;
  $a=CGI-new();
  print $a-header(text/html\n\n);
  @name=$a-param;
  foreach(@name)
  {
   @values=$a-param($_);
   print qq/@values\n/;
   }
thanks,
visu

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



Re: regarding CGI.pm---sorry for posting again

2003-07-24 Thread Steve Grazzini
On Thu, Jul 24, 2003 at 11:50:17PM +0530, Visu wrote:
 Hi,
 I have a cgi code like the one below.when i run this program
 i got the error message as premature end of script headers in my server's 
 error log.I am new to this CGI module.
 
   use CGI;
   $a=CGI-new();
   print $a-header(text/html\n\n);
   

You shouldn't use those newlines.  The header() method
will take care of all that for you.

-- 
Steve

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



RE: HTH

2003-07-24 Thread Jeff Westman


...and here I thought it meant hacker-to-hacker.  Silly me.



JW


--- [EMAIL PROTECTED] wrote:
 
 
 On Thu, 24 Jul 2003 08:32:27 -0700 (PDT), Jeff Westman [EMAIL PROTECTED]
 wrote:
 
  Hi,
  
  Okay guys, what does this mean?  Several of you 'sign' with this.
  
  HTH (lol)
  
 
 Or when used at the top of a posting, Hope This Helps as opposed to the
 bottom That Helped
 
 For those uninitiated if you ever see a term similar to this that you don't
 understand have a look here
 
 http://info.astrian.net/jargon/terms/h.html#HTH
 
 HAND,
 
 http://danconia.org
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: regarding CGI.pm---sorry for posting again

2003-07-24 Thread Dan Muey

 Hi,

Howdy!

 I have a cgi code like the one below.when i run this program
 i got the error message as premature end of script headers in 
 my server's 
 error log.I am new to this CGI module.
 
   use CGI;
   $a=CGI-new();
   print $a-header(text/html\n\n);

Header() does text/html by default so all you need to dois:
   print $a-header();
And if you are specifying the content type in the function call you don't need the 
tewo newlines:

 print $a-header('text/html');

HTH
DMuey

   @name=$a-param;
   foreach(@name)
   {
@values=$a-param($_);
print qq/@values\n/;
}
 thanks,
 visu
 
 -- 
 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: regarding CGI.pm---sorry for posting again

2003-07-24 Thread wiggins


On Thu, 24 Jul 2003 23:50:17 +0530 (IST), Visu [EMAIL PROTECTED] wrote:

 Hi,
 I have a cgi code like the one below.when i run this program
 i got the error message as premature end of script headers in my server's 
 error log.I am new to this CGI module.
 
   use CGI;
   $a=CGI-new();
   print $a-header(text/html\n\n);
   @name=$a-param;
   foreach(@name)
   {
@values=$a-param($_);
print qq/@values\n/;
}

I assume you have a shebang line (#!) or that your server is setup to handle it 
correctly.

Are you sure the CGI module is installed? Have you verified that the syntax in the 
script is correct (perl -c)?  Can you run it from a command line and is it displayed 
correctly?

Usually this is caused by not printing a header (which you apparently are doing), or 
by printing something to STDOUT before a valid header, or because the script won't run 
at all

http://danconia.org

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



RE: HTH

2003-07-24 Thread Charles K. Clarkson
Jeff Westman [EMAIL PROTECTED] wrote:
: 
: Okay guys, what does this mean?  Several of you 'sign' with this.
: 
: HTH

Last week when the blower went out on the central A/C,
it meant Hotter Than Hell.


HTH,

Charles K. Clarkson
-- 
Head Bottle Washer,
Clarkson Energy Homes, Inc.
Mobile Home Specialists
254 968-8328


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



RE: eleminating dupes in @list

2003-07-24 Thread Charles K. Clarkson
Juergen Bertram wrote:
: 
: hi,
: 
: I need a procedure to eleminate dupes in a @list
: 
: Ex: @list1 = qw(two one two zero six five six seven zero);
: 
: should be changed to:
: 
: @list2 = qw(two one zero six five seven);
: 
: There's no need to sort the list.

   Quantum::Superpositions is a staggeringly difficult
read, but I was able to hear a lecture a few years
ago by Damian Conway. It can handle this job, but
don't ask me to explain exactly how it works:

use Quantum::Superpositions qw| eigenstates any |;

my @not_unique = qw|two one two zero six five six seven zero|;

my @unique = eigenstates( any( @not_unique ) );

print Dumper [EMAIL PROTECTED];


One advantage is that this method is
it will run instantaneously on a quantum
computer.



HTH,

Charles K. Clarkson
-- 
Head Bottle Washer,
Clarkson Energy Homes, Inc.
Mobile Home Specialists
254 968-8328



















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



RE: regarding CGI.pm---sorry for posting again

2003-07-24 Thread Dan Muey
   print $a-header('text/html');
 
 Even after removing all the arguments inside the header i got 
 the same 
 error.This is true even without specifying new line as in the 
 second case.


Ok then, make sure there's no output before that header() line.
Make sure the web server is configured properly to run the script 
the way you're expecting and that you'e script is configured to 
run properly.

What is the output form the command line?

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



RE: eleminating dupes in @list

2003-07-24 Thread Dan Muey
Quantum::Superpositions is a staggeringly difficult
 read, but I was able to hear a lecture a few years
 ago by Damian Conway. It can handle this job, but
 don't ask me to explain exactly how it works:
 
 use Quantum::Superpositions qw| eigenstates any |;
 
 my @not_unique = qw|two one two zero six five six seven zero|;
 
 my @unique = eigenstates( any( @not_unique ) );
 
 print Dumper [EMAIL PROTECTED];
 

I've browsed the Quantum module trying to find a use for it in my doings. 
I like the example use of it here thanks.

 
 One advantage is that this method is
 it will run instantaneously on a quantum
 computer.

I think Apple is coming out with one of those next month :)

Dan

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



RE: eleminating dupes in @list

2003-07-24 Thread Joshua Colson
How about just:

@list = (qw(two one none zero seven two zero))

foreach my $elem ( @list ) { 
  $list{$elem}++; 
}

@list = ();

foreach my $key ( keys %list ) {
  push(@list,$key);
}

To explain:
  Each non-unique element in the list will simply increment the unique
hash key, then read back all the hash keys into your list.


On Thu, 2003-07-24 at 12:23, Charles K. Clarkson wrote:
 Juergen Bertram wrote:
 : 
 : hi,
 : 
 : I need a procedure to eleminate dupes in a @list
 : 
 : Ex: @list1 = qw(two one two zero six five six seven zero);
 : 
 : should be changed to:
 : 
 : @list2 = qw(two one zero six five seven);
 : 
 : There's no need to sort the list.
 
Quantum::Superpositions is a staggeringly difficult
 read, but I was able to hear a lecture a few years
 ago by Damian Conway. It can handle this job, but
 don't ask me to explain exactly how it works:
 
 use Quantum::Superpositions qw| eigenstates any |;
 
 my @not_unique = qw|two one two zero six five six seven zero|;
 
 my @unique = eigenstates( any( @not_unique ) );
 
 print Dumper [EMAIL PROTECTED];
 
 
 One advantage is that this method is
 it will run instantaneously on a quantum
 computer.
 
 
 
 HTH,
 
 Charles K. Clarkson
 -- 
 Head Bottle Washer,
 Clarkson Energy Homes, Inc.
 Mobile Home Specialists
 254 968-8328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


signature.asc
Description: This is a digitally signed message part


Sorting Help (***) URgENT!

2003-07-24 Thread [EMAIL PROTECTED]
I am trying to get this written for a presentation in the morning (gotta
love it when the boss dumps a pile of stuff with 3 hours left in the day)
and I have a massive file that is a flat file database (| delimited) that I
need to sort through to get all the *** entries out of.  The file format is
this:

sub Itemslist 
{
 $database_file = /home/web/sales/info/salesa1;
 $trip = ***;
 open(INF,$database_file) or dienice(Can't open $database_file: $! \n);
 @grok = INF;
 close(INF);
 $file1 = /home/web/sales/itemlist.html;
 open (FILE, $file1) || die Can't write to $file1 : error $!\n;

 print FILE htmlheadtitle*** Item List/title/headbody
bgcolor=white text=black\ntable border=1\ntrtdBItem
Num/B/tdtdBDescription/B/tdtdBB2/B/tdtdBCat
Code/B/tdtdBVendor Num/B/td/tr\n;

 foreach $i (@grok)
 {
 if ($i =~/$trip/)
  {
   chomp($i);
   ($item_num,$item_desc,$b1,$b2,$b3,$b4,$cat_code,$vend_num) =
split(/\|/,$i);
   print FILE
trtd$item_num/tdtd$item_desc/tdtd$b2/tdtd$cat_code/tdtd
$vend_num/td/tr\n;
  }
 }
 print FILE /table/body/html\n;
}



The ***  I have tried to escape with \*\*\* and /\*/\*/\*

The entries is the $item_desc that contains the *** and when it DOES find
one, it needs to print it out to the file, the others it needs to ignore.

HELP!

Robert


mail2web - Check your email from the web at
http://mail2web.com/ .



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



RE: eleminating dupes in @list

2003-07-24 Thread Dan Muey
 How about just:
 
 @list = (qw(two one none zero seven two zero))

Here's a shorter easier way to do your example:
@list = qw(two one none zero seven two zero);

 
 foreach my $elem ( @list ) { 
   $list{$elem}++; 
 }

for(@list) { $list{$_}++; }

 
 @list = ();
 
 foreach my $key ( keys %list ) {
   push(@list,$key);
 }

@list = (keys %list);

 
 To explain:
   Each non-unique element in the list will simply increment 
 the unique hash key, then read back all the hash keys into your list.

Although why not just do it all in one line?

@list = do { my %t;grep !$t{$_}++, @list };

HTHIKIDM
(FYI of rll those followint the HTH thread - This is Hope [This|That] Helps I 
Know It Did Me
Coined by Me today July 24, 2003)

DMuey

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



Re: Sorting Help (***) URgENT!

2003-07-24 Thread Shawn
I think instead of /$trip/ you ought to use /\Q$trip\E/

Check out the Quote and Quote-like Operators section of perlop.

On Thu, 2003-07-24 at 14:57, [EMAIL PROTECTED] wrote:
 I am trying to get this written for a presentation in the morning (gotta
 love it when the boss dumps a pile of stuff with 3 hours left in the day)
 and I have a massive file that is a flat file database (| delimited) that I
 need to sort through to get all the *** entries out of.  The file format is
 this:
 
 sub Itemslist 
 {
  $database_file = /home/web/sales/info/salesa1;
  $trip = ***;
  open(INF,$database_file) or dienice(Can't open $database_file: $! \n);
  @grok = INF;
  close(INF);
  $file1 = /home/web/sales/itemlist.html;
  open (FILE, $file1) || die Can't write to $file1 : error $!\n;
 
  print FILE htmlheadtitle*** Item List/title/headbody
 bgcolor=white text=black\ntable border=1\ntrtdBItem
 Num/B/tdtdBDescription/B/tdtdBB2/B/tdtdBCat
 Code/B/tdtdBVendor Num/B/td/tr\n;
 
  foreach $i (@grok)
  {
  if ($i =~/$trip/)
   {
chomp($i);
($item_num,$item_desc,$b1,$b2,$b3,$b4,$cat_code,$vend_num) =
 split(/\|/,$i);
print FILE
 trtd$item_num/tdtd$item_desc/tdtd$b2/tdtd$cat_code/tdtd
 $vend_num/td/tr\n;
   }
  }
  print FILE /table/body/html\n;
 }
 
 
 
 The ***  I have tried to escape with \*\*\* and /\*/\*/\*
 
 The entries is the $item_desc that contains the *** and when it DOES find
 one, it needs to print it out to the file, the others it needs to ignore.
 
 HELP!
 
 Robert
 
 
 mail2web - Check your email from the web at
 http://mail2web.com/ .
 
 

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



Re: eleminating dupes in @list

2003-07-24 Thread John W. Krahn
[ Please do NOT use BCC to post to the list.  I almost LARTed your ISP
for spam! ]

[ Please do NOT post TOFU. 
http://www.catb.org/~esr/jargon/html/T/TOFU.html ]

[ Please do NOT post MIME.  Plain text only please. ]

TIA


 From: [EMAIL PROTECTED] (Joshua Colson)
 
 --=-I+4r6wUBW1XZ3HpXebVk
 Content-Type: text/plain
 Content-Transfer-Encoding: quoted-printable
 
 How about just:
 
 @list =3D (qw(two one none zero seven two zero))
 
 foreach my $elem ( @list ) {=20
   $list{$elem}++;=20
 }
 
 @list =3D ();
 
 foreach my $key ( keys %list ) {
   push(@list,$key);
 }
 
 To explain:
   Each non-unique element in the list will simply increment the unique
 hash key, then read back all the hash keys into your list.
 
 
 On Thu, 2003-07-24 at 12:23, Charles K. Clarkson wrote:
  Juergen Bertram wrote:
  :=20
  : hi,
  :=20
  : I need a procedure to eleminate dupes in a @list
  :=20
  : Ex: @list1 =3D qw(two one two zero six five six seven zero);
  :=20
  : should be changed to:
  :=20
  : @list2 =3D qw(two one zero six five seven);
  :=20
  : There's no need to sort the list.
 =20

[snip]

 =20
 =20
 =20
 =20
 =20
 =20
 
 --=-I+4r6wUBW1XZ3HpXebVk
 Content-Type: application/pgp-signature; name=signature.asc
 Content-Description: This is a digitally signed message part
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.2.1 (GNU/Linux)
 
 iD8DBQA/IDYlmaVCbcUtCVkRApL+AJ90me1g03qQJHINND/2H+0MSA2D3wCdGXzH
 vth9ggnMtce7tlUKFZmW1kE=
 =yedu
 -END PGP SIGNATURE-
 
 --=-I+4r6wUBW1XZ3HpXebVk--


John
-- 
use Perl;
program
fulfillment

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



man2txt

2003-07-24 Thread I. Oppenheim
I've written a simple C program, that filters the
output of the man unix program, to make readable text
out of it. It works like this: man perl | man2txt  perl.txt

What would be the best way to code this in Perl?
Could anyone translate the following code in a native
Perl idiom for me?


/ man2txt.c */
#include stdio.h

int main (void) {

char prev = 0, cur = 0 ;

cur = getchar () ;
while (!feof (stdin)) {
if (cur == 8) {
cur = 0 ;
} else if (prev != 0) {
putchar (prev) ;
}
prev = cur ;
cur = getchar () ;
}
return 0 ;
}


Thanks!


 Groeten,
 Irwin Oppenheim
 [EMAIL PROTECTED]
 ~~~*

 Chazzanut Online:
 http://www.joods.nl/~chazzanut/

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



RE: perl program

2003-07-24 Thread david
Reggie Kogulan wrote:

 Aaron,
 What I am looking is to distribute the executable only. Not the code. like
 a compiled C program will generates a.out or jar file in java. Thats all I
 am looking for.
 
 Someone earlier said to use perlcc. Which I did now. I do not see an
 executable file.
 
 example: $perlcc -o testfile test.pl
 
 Did not produce testfile at all.
 Is there something else I need to do?
 

perlcc is experimental so don't be suprise if it doesn't work. you can 
generate the c file and compile it yourself (asking for perlcc to generate 
the c code might be easier then asking it to generate the binary for you). 
following these steps (assuming your perl script is named script.pl):

[panda]$ perlcc -S script.pl
[panda]$ perl -MConfig -e 'print $Config{cc}\n'
[panda]$ perl -MExtUtils::Embed -e ccopts -e ldopts
[panda]$ gcc -o script.out script.c options from above
[panda]$ file script.out
[panda]$ script.out

steps:

1. ask perlcc to generate a script.c file from script.pl
2. ask Config to show us what compiler is Perl itself compiled into. You 
will need to use the same complier! in my box, it's a gcc
3. Ask ExtUtil to show us what options Perl itself is compiled into. this 
will print long option line so you will probably want to ' options.txt'
4. use gcc to compile script.c into a binary script.out. 'options from 
above' means whatever you store into options.txt in step 3. without the 
options, gcc probably won't compile correctly.
5. simply shows you that you really end up with a binary for your os
6. runs it.

if you are having problem compiling the c source, it's probably due to 
missing headers, use the following to find out where those headers such as 
EXTERN.h and perl.h are really locaed:

[panda]$ perl -MConfig -e 'print $Config{archlib}\n'

i have been using this method to generate some simply perl binaries for fun. 
if that doesn't work for you, forget you ever heard perlcc. :-)

david

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



Re: man2txt

2003-07-24 Thread John W. Krahn
I. Oppenheim wrote:
 
 I've written a simple C program, that filters the
 output of the man unix program, to make readable text
 out of it. It works like this: man perl | man2txt  perl.txt

If you have man pages then you must be on *nix and if you are on *nix
you should use the col program to convert man to txt.

man perl | col -b  perl.txt

man col


 What would be the best way to code this in Perl?
 Could anyone translate the following code in a native
 Perl idiom for me?
 
 
 / man2txt.c */
 #include stdio.h
 
 int main (void) {
 
 char prev = 0, cur = 0 ;
 
 cur = getchar () ;
 while (!feof (stdin)) {
 if (cur == 8) {
 cur = 0 ;
 } else if (prev != 0) {
 putchar (prev) ;
 }
 prev = cur ;
 cur = getchar () ;
 }
 return 0 ;
 }

The perl translation of the C code (although this is probably not the
best way) is:

#!/usr/bin/perl

$/ = \1;
while (  ) {
if ( $_ eq \010 ) {
$_ = \0;
} elsif ( $prev ne \0 ) {
print $prev;
}
$prev = $_;
}


John
-- 
use Perl;
program
fulfillment

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



performance tuning in perl

2003-07-24 Thread Phil Schaechter
Does anyone know of any performance tuning tools for perl?  I'd like to 
analyze my programs to see where it is spending the most time.

If anyone has any suggesstions, I'd appreciate it.

-Phil

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



RE: performance tuning in perl

2003-07-24 Thread Hanson, Rob
You can use Devel::DProf, it comes with Perl.

# run the script with profiling turned on
perl -d:DProf diagnostics.pl

# use the dprofpp tool to view the stats
dprofpp

This article explains it a bit.
http://www.perl.com/pub/a/2002/07/16/mod_perl.html

Rob


-Original Message-
From: Phil Schaechter [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 6:33 PM
To: [EMAIL PROTECTED]
Subject: performance tuning in perl


Does anyone know of any performance tuning tools for perl?  I'd like to 
analyze my programs to see where it is spending the most time.

If anyone has any suggesstions, I'd appreciate it.

-Phil

-- 
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]



[OT] Re: Kinda Perl

2003-07-24 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote:
I have been writing perl along with some other languages, and I have been thinking about setting up a server (so that I can play with different server OS's and settings without messing anything up on our home network). My parents think that it will cost to much in power. I was just wondering if anyone knows about how much it is per day to run a computer without a monitor.

Well I saw a variety of figures given after doing a couple of Google 
searches, ranging from $35-150 per year, and this page:

http://michaelbluejay.com/electricity/howmuch.html

Which had the best information. This depends on the type of computer, is 
it a Pentium 90 (which I doubt if you are HS intern ;-)) or is it a 
dualie-Xeon 1 Ghz (which I also doubt for the same reason ;-))? It also 
very much depends on where you live, I am assuming the states? I would 
check the power supply rating and ask your parent's for the cost per 
kilowatt/hour on their electrical bill, then you should be able to 
figure what your usage would be. The above link provides a 
computer+monitor, but it also provides a 19 television, it is probably 
reasonable to subtract teh TV from the computer+monitor to get just the 
computer since the monitor is definitely the heft of the load and likely 
similar to a TV.

Also remind your parents that this is an educational thing, it isn't 
like you are going to be playing computer games on it (unless you are 
setting up a quake server in which case that doesn't count ;-)) and that 
the benefits of learning are actually an investment for a relatively 
small marginal cost.

Most of the figures I saw on the web were also for 24/7 usage, which 
while it is pain in the rear there is no real need to leave it running 
constantly if it is just a box to tinker with.

Good luck, you have stumbled on to probably the best way to learn about 
computers, aka breaking them (at least the OS)

http://danconia.org

1995 numbers: 
http://it.erau.edu/NewsnLinks/energy_efficiency/energy_efficiency.html

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


Perl and Expect

2003-07-24 Thread David Abouav
Hi,

I'm using Perl with the Expect module. Sometimes when I spawn off a new process 
using Expect, I see this error:

Error: could not connect pty as controlling terminal!

It usually happens when I'm running several other Perl scripts, also using 
Expect, on the same machine.

Does anyone have any idea what this means, what can cause it, and how I can fix 
it? If this question is too high-level for this mailing list, would you tell me 
where I can better direct this question?

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


IDE for Perl Development

2003-07-24 Thread Trevor Morrison
HI,

Is there any type of IDE that I can use for Perl programming (free of
course) that will run both on Windows 2000 and Linux?

TIA

Trevor


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



  1   2   >