Re: problem with variables

2001-04-17 Thread Sean O'Leary
At 10:59 AM 4/17/2001, you wrote: >i have this program: > >$sup1='a'; >$sup2='b'; >$sup3='c'; > >for ($i=1 ; $i<4 ;$i++){ > print $sup($i); >} > >but give error, why??? First off, you need to make an array. All you have are some scalars with similar names. You could use symbolic references

Retract: Running a script

2001-04-17 Thread Nicholas Bacon
I was able to get the script running by adding 'perl' to the path. Thus, the command line read perl txt2html.pl sample.txt > sample.html This did not work on the original box I was working on, but on a different box, which makes me think it is something to do with the system setup, maybe

Re: Running a script

2001-04-17 Thread Tad McClellan
On Tue, Apr 17, 2001 at 04:14:28PM -0700, Nicholas Bacon wrote: > I downloaded a script that can convert a plain text > file to HTML, called txt2html.pl . It starts > with #!/usr/bin/perl, which should mean I can treat > it as an executable at the prompt, after I've > performed a chmod to ma

Running a script

2001-04-17 Thread Nicholas Bacon
I downloaded a script that can convert a plain text file to HTML, called txt2html.pl . It starts with #!/usr/bin/perl, which should mean I can treat it as an executable at the prompt, after I've performed a chmod to make the file executable. I did this and at the prompt, I type txt2htm

POP3Client module

2001-04-17 Thread lists
Hi, About the POP3Client module.. I have it work almost perfectly, apart from one part: when I try to delete a message on the pop server I get an error asking for auto/Mail/POP3Client/delete.al I know .pl, .pm, .cgi etc files but what is this .al file?! And where do I obtain it? (cannot find

Re: Decimal to Binary conversion

2001-04-17 Thread Casey West
On Wed, Apr 18, 2001 at 12:35:31AM +0200, Paul Johnson wrote: : On Tue, Apr 17, 2001 at 05:20:05PM -0400, Casey West wrote: : : > Now, if you really want your first two numbers in binary form, you can : > try something along these lines: : : It is actually much, much easier than that Casey ;-) :

Re: Decimal to Binary conversion

2001-04-17 Thread Paul Johnson
On Tue, Apr 17, 2001 at 05:20:05PM -0400, Casey West wrote: > Now, if you really want your first two numbers in binary form, you can > try something along these lines: It is actually much, much easier than that Casey ;-) printf "%b\n" for @ARGV; if your perl >= 5.6.0 -- Paul Johnson - [EMAIL

Re: Decimal to Binary conversion

2001-04-17 Thread Casey West
On Tue, Apr 17, 2001 at 03:53:39PM -0500, Gray, Brad D wrote: : Hi, : : Is there a way to convert two numbers from decimal to binary, and AND them : together, and convert the result back to decimal? It is actually much, much easier than that Brad. Perl has a bitwise AND operator ( see perlop ):

RE: referencing and subroutines.

2001-04-17 Thread Colby DeRodeff
how do you get off this list? >From: blowther <[EMAIL PROTECTED]> >To: "'Martijn van Exel'" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] >Subject: RE: referencing and subroutines. >Date: Tue, 17 Apr 2001 14:51:20 -0600 > >You could return the data by reference... The documentation is at > >perldoc pe

Decimal to Binary conversion

2001-04-17 Thread Gray, Brad D
Hi, Is there a way to convert two numbers from decimal to binary, and AND them together, and convert the result back to decimal? Thanks, Brad

Re: Dividing up text files, HELP!!

2001-04-17 Thread Tad McClellan
On Tue, Apr 17, 2001 at 01:33:39PM -0700, Paul Jasa wrote: > I want to be able to divide up a text file by using specific > words in the text, in other words, I'd like to be able to tell the script > to: > > Read file ./FILE, and from that file, my $file = do { local $/; }; # slu

RE: referencing and subroutines.

2001-04-17 Thread blowther
You could return the data by reference... The documentation is at perldoc perlref But in summary it would be sub parse { my $hashRef = {}; $hashRef->{ONE} = 45; return $hashRef } my $result = parse(); print $result->{ONE}; -Original Message- From: Martijn v

Re: Dividing up text files, HELP!!

2001-04-17 Thread Bkwyrm
I have used join in order to make one big line of a document for searches such as the one you suggest. Also, in another script I did this: open(FILE,"$_"); my $txt = ""; $searchfile = $_; while () {$txt .= $_;} close(FILE); ## Search $txt for $string; if it is found, write the name

Re: referencing and subroutines

2001-04-17 Thread Matt Cauthorn
To get a value out of a subroutine you need to use the return function. So if your sub creates the hash and you want to do something with it in the script outside, do something like; %newhash=subroutine(values); I believe you may also simply reference the hash within the subroutine, but you shou

referencing and subroutines.

2001-04-17 Thread Martijn van Exel
Hi all, I'm new to this list and quite new to Perl. I'm on digest, so I'd appreciate a cc. I have written a subroutine to parse a text file containing a flat file database. The data ends up in a hash of hashes, say %datafile. This hash is created on the spot, looping through the data in a foreac

Dividing up text files, HELP!!

2001-04-17 Thread Paul Jasa
Dear all, I have tried various things, and read and searched the Camel book, the Llama book, and another Perl reference to no avail. Your help would be much appreciated. I want to be able to divide up a text file by using specific words in the text, in other words, I'd like to be able to tell

Re: problem with variables

2001-04-17 Thread James Fisher
Good point ... note to self ... don't try and help people while to busy to really focus on problem. I jumped down to the loop without looking at the code Tad McClellan wrote: > On Tue, Apr 17, 2001 at 02:01:14PM -0700, James Fisher wrote: > > > the array starts at 0 not 1 > ^ > > The

Re: problem with variables

2001-04-17 Thread Tad McClellan
On Tue, Apr 17, 2001 at 02:01:14PM -0700, James Fisher wrote: > the array starts at 0 not 1 ^ There is no array in the code given (but there probably should be). > you should realy look at foreach instead > > > Pacifico wrote: > > > i have this program: > > > > $sup1='a'; > > $su

Re: problem with variables

2001-04-17 Thread James Fisher
the array starts at 0 not 1 you should realy look at foreach instead Pacifico wrote: > i have this program: > > $sup1='a'; > $sup2='b'; > $sup3='c'; > > for ($i=1 ; $i<4 ;$i++){ > print $sup($i); > } > > but give error, why???

RE: problem with variables

2001-04-17 Thread blowther
So your saying that Perl can handle calculating cosine while iterating through Pi? for my $inc (-3.14159 .. 3.14159) { push @result, cos($inc); } Come on... C style for loops have their place. -Original Message- From: Brent Michalski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, A

Re: problem with variables

2001-04-17 Thread Brent Michalski
To add to the answer(s) already given... for ($i=1 ; $i<4 ;$i++){ print $sup($i); } is actually quite cumbersome, and very 'C'-ish... Let's make it more Perl-ish... for my $i (1..4){ print $i; } There is not need to have to deal with incrementing and checking conditions in loops - Perl

Re: problem with variables

2001-04-17 Thread David M. Lloyd
On Tue, 17 Apr 2001, Pacifico wrote: > i have this program: > > $sup1='a'; > $sup2='b'; > $sup3='c'; > > for ($i=1 ; $i<4 ;$i++){ > print $sup($i); > } > > but give error, why??? Because, basically, you can't do that. To get the result you want, you have to do this instead: # Begin perl

problem with variables

2001-04-17 Thread Pacifico
i have this program: $sup1='a'; $sup2='b'; $sup3='c'; for ($i=1 ; $i<4 ;$i++){ print $sup($i); } but give error, why???

Re: login help

2001-04-17 Thread James Fisher
You need to use the -l parameter to specify the login name ssh 192.168.2.21 -l arfan you can type ssh --help to get a list of params Nyx arfan wrote: > dear all > i have created a username on debian machine .now i want ssh to that > machine so there comes always root passwd > > ssh 192.168.2

Re: As relates to Software QA

2001-04-17 Thread Michael Mitchell
Thanks for the pointer! Knowing "DBI" and the references are great. IndigoPerl has mSQL and faq has the syntax or exampled script. Many thanks! -mike mitchell - Original Message - From: "Peter Scott" <[EMAIL PROTECTED]> To: "Michael Mitchell" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent

Re: As relates to Software QA

2001-04-17 Thread Casey West
On Mon, Apr 16, 2001 at 07:36:07PM -0700, Peter Scott wrote: : [I'm going to keep this in the group, others deserve to see the answers.] : : At 02:25 AM 4/17/01 +, Michael Mitchell wrote: : >Thanks again! : > : >Frequently need to do data validation, NT based intranet, SQL : >server. Using

Re: login help

2001-04-17 Thread Brent Michalski
Have you tried looking at the ssh manpage? It states that you may want to try this... ssh -l username host good luck, Brent P.S.: For all of the beginners out there, don't forget about the man pages and documentation that is readily available on your system! The documentation is there to he

List Suggestion

2001-04-17 Thread Brent Michalski
I am not sure who the listmaster is so... Would it be possible/feasable to add something like [beginner] to all of the subject lines of this mailing list? The HTML::Mason list adds [mason] to the beginning of each messages subject. This makes sorting and filtering much easier. Thanks, Brent

Re: how to use crypt() function to encrypt and decrypt shell user pass

2001-04-17 Thread Brent Michalski
Keep in mind that the crypt() function is ONE WAY! You can encrypt, but not decrypt. This may sound useless, but what you do is to encrypt what the user sends, ecrypt it, then compare the encrpted version with the encrypted password. If the two match, then the password was correct. Type: perl