Re: Authen::SMB

2005-01-24 Thread Tor Hildrum
On Mon, 24 Jan 2005 10:09:09 +, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Morning > > Do anyone know where I can get information on how this module work? I've > search the Internet nothing so-far. www.cpan.org would be a good place to start: http://search.cpan.org/~pmkane/Authen-Smb-0.91

Re: Cannot create the file~

2005-01-19 Thread Tor Hildrum
On Thu, 20 Jan 2005 10:45:42 +0530, Anish Kumar K. <[EMAIL PROTECTED]> wrote: > Hi > > I am new to CGI..I cannot create a file using CGI. I do execute another > program to create a file, it executes fine..But while using CGI it fails. > > I had used a die statement and after that I tried prin

Re: Retrieving data from telephone system.

2005-01-19 Thread Tor Hildrum
On Tue, 18 Jan 2005 17:04:13 -0600, Jason Balicki <[EMAIL PROTECTED]> wrote: > I'm looking for some help with a little project Unless your going to ask for help with some actual code you have written, this is better suited for [EMAIL PROTECTED] regards Tor -- To unsubscribe, e-mail: [EMAIL PRO

Re: losing a value after chomp()

2005-01-18 Thread Tor Hildrum
On Tue, 18 Jan 2005 15:15:00 +, RichT <[EMAIL PROTECTED]> wrote: > Grate that worked, the varible must of have a \r and a \n at the end. > thank you very much... > > how would i find our what escape chars are in a varible? > or is there a way to print out a string with out perl translating th

Re: losing a value after chomp()

2005-01-18 Thread Tor Hildrum
On Tue, 18 Jan 2005 13:22:14 +, RichT <[EMAIL PROTECTED]> wrote: > Hi again, > ok i made the changes sugested, but something is still wrong. > the output im getting is > -- > "interface is "ATM0 > "interface is "A

Re: Counting occurences of a char in a line

2005-01-17 Thread Tor Hildrum
On Tue, 18 Jan 2005 01:08:56 +0100, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > foreach my $line () { > if ( $line =~ /^[^,]*(?:,[^,]*){10}$/) ) { > print OUT $line; > } > } > > That is check whether the full string is "something not containing > comma followed by ten times comma

Re: Forcing script to run as root?

2005-01-17 Thread Tor Hildrum
On Mon, 17 Jan 2005 14:08:10 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Worked perfectly. I knew it was something simple. Thanks! > > Never used POSIX before. Looked at it on cpan but those descriptions can be > flat sometimes. If you don't mind, what are some practical uses for it? Jus

Re: losing a value after chomp()

2005-01-17 Thread Tor Hildrum
On Mon, 17 Jan 2005 17:57:28 +, RichT <[EMAIL PROTECTED]> wrote: > Hi All, > >time for me to ask dumb questions again... > > I have a script, what i want it to do is scan through a Cisco > router Config file (nicely saved in a text file already so no need for > and SNMP), then outpu

Counting occurences of a char in a line

2005-01-17 Thread Tor Hildrum
Hi, I have the following code in a script I'm writing: foreach my $line () { if ( 10 == ($line =~ s/,/,/g) ) { print OUT $line; } } Is this poor style? It looks a bit ugly, but I can't figure out a better way to do it. I'm sure there is :) The script will be reused and probably m

Re: CGI.pm and form creation

2005-01-17 Thread Tor Hildrum
On Mon, 17 Jan 2005 14:41:40 +0100, Mauro <[EMAIL PROTECTED]> wrote: > I'm trying to create a little form usign CGI.pm but I get this error from > apache: > malformed header from script. Bad header= checkbox(-name=>'usr',-checked=>1), > checkbox(-name=>'sys',-checked=>0), >

Re: Substitute Varaible

2005-01-17 Thread Tor Hildrum
On Mon, 17 Jan 2005 16:11:54 +0530, Anish Kumar K. <[EMAIL PROTECTED]> wrote: > Hi I need help regarding substituion of varaibles with values > > Say I have a txt file (a.txt) > > which has only one line: > Hi $name Don't think of $name as a perl variable, but as a placeholder. It looks better i

Re: doubt with hash

2005-01-13 Thread Tor Hildrum
On Fri, 14 Jan 2005 12:09:03 +0530, Anish Kumar K. <[EMAIL PROTECTED]> wrote: > Hi All > > I have a hash say. %browserType in which assume there are values... > > %browserType=( > "IE"=>2, > "NETSCAPE"=>3, > "FIREFOX"=>5 > ); > > I need to calculate one morething say percentage utilisation for e

Re: Pattern matching variables

2005-01-13 Thread Tor Hildrum
On Wed, 12 Jan 2005 17:27:46 -0700, Dan Fish <[EMAIL PROTECTED]> wrote: > Are ALL pattern matching variables set back to undef once another m// or > s/// expression is encountered, even if it contains no parenthized > expressions? > > For example, I would have expected $1 & $2 to be valid in BOTH

Re: Execute a perl array

2005-01-12 Thread Tor Hildrum
On Wed, 12 Jan 2005 08:55:14 +0200, Groleo Marius <[EMAIL PROTECTED]> wrote: > Hi list! ( as usual ) > i have a simple question : how can i execute an array, knowing that it > contains perl code? eval for @array; Example: tor% perl -e '@array = ("print \"hi!\n\"", "print \"hello\n\""); eval for @

Re: return value for associate array

2004-12-16 Thread Tor Hildrum
On Fri, 17 Dec 2004 15:23:35 +0800, Khairul Azmi <[EMAIL PROTECTED]> wrote: Hi, start your script with: #!/usr/bin/perl -w use strict; > sub get_conf { > my $local_file = $_[0]; > my @local_conf; local_conf is an array. An assosiative array in Perl, is called a hash. You declear it with

Re: any perl project ideas

2004-12-14 Thread Tor Hildrum
On Tue, 14 Dec 2004 23:10:48 -0800 (PST), Harbhajan Julka <[EMAIL PROTECTED]> wrote: > Hey all, > Need some pointers to perl projects that use all the > major functionalities of perl. Please pass your ideas > as soon as you can. I've been working on perl in > theory and tried some small programs to

Re: control loop question

2004-12-14 Thread Tor Hildrum
On Mon, 13 Dec 2004 14:46:13 -0800 (PST), Christopher Spears <[EMAIL PROTECTED]> wrote: > Hi! > > Let's say I have a text file filled with: > > stuff > stuff > stuff > Users sometext > tom > dick > harry > Users more sometext >

Re: A question about flock()

2004-12-13 Thread Tor Hildrum
On Tue, 14 Dec 2004 11:03:56 +0800, Shu Hung (Koala) <[EMAIL PROTECTED]> wrote: > Hello, > I wrote a script which involved writing a file, which may als be writing > by another script. To prevent crashes, I want to used the flock() function. > > my question is: > How do I check if a file is locked

Re: remote database access in perl

2004-12-13 Thread Tor Hildrum
On Mon, 13 Dec 2004 17:55:12 +0500, Adam Saeed <[EMAIL PROTECTED]> wrote: > I have written a simple program that should get data from a remote > database, but it is not working giving error: > DBI->connect(sugs:192.168.14.2) failed: Host 'www.sample.com' is not > allowed to connect to this MySQL se

Re: Write to file and tty from same print call

2004-12-12 Thread Tor Hildrum
On Sun, 12 Dec 2004 19:32:53 -0600, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Yeah, probably something like that but what else needs to be in there > to make the example work? Wild guess: #!/usr/bin/perl use IO::Tee; open($handle1, "file1") or die("No!"); open($handle2, "echo") or die("No2

Re: Write to file and tty from same print call

2004-12-12 Thread Tor Hildrum
On Sun, 12 Dec 2004 15:33:44 -0600, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Trying to see something of how it works: > > #!/usr/local/bin/perl -w > use IO::Tee; > my ($handle1, $handle2); > $handle1 = "./one" > $handle2 = "./two" > $tee = IO::Tee->new($handle1, $handle2); I have never use

Re: want to get the count of rows of a table from oracle database using perl script

2004-12-09 Thread Tor Hildrum
On Wed, 8 Dec 2004 22:49:25 -0800 (PST), Priyanka krishnaraj <[EMAIL PROTECTED]> wrote: > Hi All > > I want to get the count of rows in paticular table of the oracle database. You want DBI and DBD::Oracle. http://www.orafaq.com/faqperl.htm Tor -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: I am looking for a free perl compiler.

2004-12-08 Thread Tor Hildrum
On Wed, 8 Dec 2004 15:26:58 -0500 (EST), Chris Devers <[EMAIL PROTECTED]> wrote: > On Wed, 8 Dec 2004, Octavian Rasnita wrote: > > > So the conclusion is that perl code cannot be really hidden (for > > comercial purposes)? > > For any purposes, yes, code cannot be hidden. It can be hidden, but i

Re: find and replace all occurance of the string from a list of files

2004-12-08 Thread Tor Hildrum
On Wed, 8 Dec 2004 15:22:39 +0530, Chandrakant Reddy <[EMAIL PROTECTED]> wrote: > Hi > >I want to replace all occurances of 'and' with '&' in all the given files In-place with backup in filename.bk: perl -pi'*.bk' -e 's/\band\b/&/g' filenames > Here the problem is the files are owned by

Re: How to replace a long string in a text file?

2003-08-14 Thread Tor Hildrum
perlwannabe wrote: Now that I have, with all of you helping, dealt with the unlink problem. I am now faced with a new problem. I have a file, myfile.txt, that consists of various text items that are repetitive. I am trying to replace many of the repetitive items with a place holder. Here is an e

Re: Perl SMS

2003-08-14 Thread Tor Hildrum
awards wrote: Hi, I was reading on the internet someone wanted to do sms with perl and he couldn't But my question is simple, can you really send SMS free of charge to anywhere in the world. No. You can write up a script that connects to a webpage and does the sending for you, but you can't physic

Re: open file into hash

2002-08-14 Thread Tor Hildrum
<[EMAIL PROTECTED]> wrote: > I have a file called people.data, which contains two colums: > jose2 > karen8 > jason9 > tracey1 > > > Can someone tell me what I am doing wrong here: > = > #! /usr/bin/perl -w > > open (INPUT,

Re: Formatting date, time

2002-08-13 Thread Tor Hildrum
<[EMAIL PROTECTED]> wrote: > #Insert Date and Time > my $month = $mon00 #Two digit month > my $day = $mday00 #Two digit day in month > my $year = $year#Two digit year ?? > my $hour = $hour00 #Two digit: Hour > my $min = $min00 #Two digit: Minutes > #Combine date and time above into MMD

Re: Replace last # with \n

2002-07-23 Thread Tor Hildrum
<[EMAIL PROTECTED]> wrote: > I have a string that looks like > > Operator Overview#PGM#Report about all configured > operators#/opt/OV/bin/OpC/call_sqlplus.sh all_oper# > > I want to replace the last "#" with a newline. I've come up with a few ideas > like > > substr ($_, rindex ($_, "#"), 1)

Re: Comparing Arrays

2002-07-23 Thread Tor Hildrum
<[EMAIL PROTECTED]> wrote: > Hi > > I would like to know how to compare 2 arrays. > > I have 2 arrays and I would like to compare the contents of the data. > It doesn't matter in which order the data is stored so long as its the same. > So comparing the bellow should read true, but if they didn

Re: #!/usr/bin/perl - is there a macro for this?

2002-06-24 Thread Tor Hildrum
> It does save quite a bit of time if you write lots of scripts. > Especially when you need a quicky to check something in a more > complex one before adding it. This is where you would use your one-liners. I'm pretty sure most people here check syntax etc on a one-liner before they post a sol

Re: Reading File

2002-06-24 Thread Tor Hildrum
> could puting the entire file into an aray then i think there is a function to > get the number of elements... then just use that to know what the last > element would be? my @array = ; print "$array[-1]"; Tor -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: Putting values into hash

2002-06-11 Thread Tor Hildrum
> read the filein... > > open(FILE, $file) or die "blah blah $!"; > undef $/; ## or local $/ if in a BLOCK > $contents = ; > close FILE; > > $contents =~ s/\\\n//g; # put everything on one line (deletes \ followed by > newline) > > foreach (split /\n/, $contents){ > ## you can figure this part

Re: invisible syntax error

2002-06-11 Thread Tor Hildrum
> hi, > > I simply wished to strip out all the ">" from a text file. below is the > script and the error that is reported. I cannot see anything wrong, it's > such a simple piece of code! can any one help, are my eyes deceiving me? [localhost:~] tor% perl -e 'while(<>) {s/\>//g; print;}' >>

Re: $FORM in Matt's wwwboard.pl

2002-06-09 Thread Tor Hildrum
> Hi guys, > I'm just looking at Matt's wwwboard.pl and try to figure out what the > $FORM{somevaule} does. > It is not declared anywhere before usage.. and I'm quite lost... > > If anyone could tell me where to find any information about that, I'd > be grateful All though a bit OT, it is normal

Re: avoiding greedy match..

2002-06-09 Thread Tor Hildrum
> BlankHi everyone, > > I need some help for preventing greedy match..I want to get rid of the > words in paranthesis in the below text. When i use the code below i loose ' > john ' because it matches the last ' )' after recovery.. Is there a easy > way to avoid this?.. > > > $target='michea

Re: probably a simple question

2002-06-05 Thread Tor Hildrum
> Is there any function to tell if a number is even or odd? > I am looking for an easy way to loop through a list and > output table cell bgcolor based on even / odd. > > if its an even numbered row make it red if its odd make > it blue. > > I have done it in the past by turning a switch on or o

Re: Getting data from console

2002-05-29 Thread Tor Hildrum
> From: "Heiko Heggen" <[EMAIL PROTECTED]> > Date: Wed, 29 May 2002 15:28:17 +0200 > To: "Beginners@Perl. Org" <[EMAIL PROTECTED]> > Subject: Getting data from console > > Hi. > > Just another question. How can I get a user input from the console in perl? > I'm just playing with the DBI Module a

Re: checking for an empty string

2002-05-28 Thread Tor Hildrum
> From: lz <[EMAIL PROTECTED]> > Date: Tue, 28 May 2002 07:08:52 -0700 (PDT) > To: [EMAIL PROTECTED] > Subject: checking for an empty string > > Hi guys, > > while($line = ) > { > if ($line =~ /^email address/) > { >} > } > > How can I check if $line contains a value or is empty? chomp

Re: Help on comparing matching two arrays

2002-05-21 Thread Tor Hildrum
> I define two arrays - one is an active changing file ( @unix = ps -ef ) and > need to compare it to a static text file @static = `cat myfile`. > > Would someone help me on the syntax of greping for @static matches in the > @unix array. > I am not sure if I need to assign a variable, for loo

Re: avoid backticking if at all possible - Re: perl awk question

2002-05-21 Thread Tor Hildrum
> From: "Taylor Lewick" <[EMAIL PROTECTED]> > Date: Tue, 21 May 2002 08:00:45 -0500 > To: <[EMAIL PROTECTED]> > Subject: avoid backticking if at all possible - Re: perl awk question > > Thanks drieux, I looked over the code you posted, most of it makes sense, but > am still a little confused over

Timing execution of a sub

2002-05-15 Thread Tor Hildrum
Are there any tricks to time the execution of a sub? Specifically I'm using the Fisher-Yates shuffle, using an array with a couple of million numbers. I want to time the shuffle. Tor -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: regexp needed

2002-05-14 Thread Tor Hildrum
> Hi, I have a file like this: > ... > SceInfEveryone = "Everyone" > SceInfGuests = "Guests" > SceInfGuest = "Guest" > SceInfPowerUsers = "Power Users" > SceInfPrintOp = "Print Operators" > .. > > And I wanted to extract Guest (without the quotes)i tried this: > > my $HISEFILE= "c:/h

Re: Split

2002-05-14 Thread Tor Hildrum
> From: Francesco Guglielmo <[EMAIL PROTECTED]> > Date: Tue, 14 May 2002 14:18:18 +0200 > To: David vd Geer Inhuur tbv IPlib <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] > Subject: Re: Split > > Many thanks!But to take it from a file and not from a variable like $line? open FILEHANDLE, /path/file.tx

Re: Suid.

2002-05-03 Thread Tor Hildrum
> >> Could someone point me to a page that gives information about all the >> pitfalls that are "available" when running a Perl or CGI script with the >> suid bit set? > :) > If you really need setuid processes - then one of the > principle tricks remains to have them 'spawned' from a > nice

Suid.

2002-05-03 Thread Tor Hildrum
Could someone point me to a page that gives information about all the pitfalls that are "available" when running a Perl or CGI script with the suid bit set? I tried google.com, but couldn't find anything god. I found this: http://www-genome.wi.mit.edu/WWW/faqs/wwwsf5.html But, it's extremely lig

Re: developing and testing first CGI/Perl application

2002-05-03 Thread Tor Hildrum
> From: "james" <[EMAIL PROTECTED]> > Date: Fri, 3 May 2002 08:54:49 -0500 > To: <[EMAIL PROTECTED]> > Subject: Re: developing and testing first CGI/Perl application > > drieux, > > i've been monitoring this list and couldn't help but notice the volume of > your posts. i have to ask: do you ever

Re: Another MySQL.

2002-05-02 Thread Tor Hildrum
> From: Felix Geerinckx <[EMAIL PROTECTED]> > Date: 2 May 2002 19:32:36 - > To: [EMAIL PROTECTED] > Subject: Re: Another MySQL. > > on Thu, 02 May 2002 19:10:48 GMT, Tor Hildrum wrote: > >> Here is the code: >> while (@arrangement) { >> chomp; &g

Re: Another MySQL. Solved by driuex :)

2002-05-02 Thread Tor Hildrum
> Here is the code: > while (@arrangement) { > chomp; > if ($_ eq $epost) { my $test = 1; } > shift(@arrangement); > } >From another mail written by driuex on the subject: "is this like some new Kult thing? It appears that this 'while' construct has popped up on both the beginner's list and the

Another MySQL.

2002-05-02 Thread Tor Hildrum
Here is the code: while (@arrangement) { chomp; if ($_ eq $epost) { my $test = 1; } shift(@arrangement); } if ($test) { ## Some more Code. The if statement always fails :( Here is what @arrangement looks like: @arrangement = qw([EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROT

Re: MySQL hangs.

2002-05-02 Thread Tor Hildrum
> From: Felix Geerinckx <[EMAIL PROTECTED]> > Date: 2 May 2002 17:55:47 - > To: [EMAIL PROTECTED] > Subject: Re: MySQL hangs. > > on Thu, 02 May 2002 17:08:47 GMT, Tor Hildrum wrote: > >> while (@arrangement) { >> chomp; >> my $test = 1 if

Re: MySQL hangs.

2002-05-02 Thread Tor Hildrum
ut what code is actually getting run - there is better ways, > but this is a beginners list :) That is great advice :) The code again: #!/usr/bin/perl use Strict; use CGI qw(:standard); use DBI; my @arrangement; my $tabell = "Oslo_220602_Vika"; my $navn = "Tor Hildrum"; my

MySQL hangs.

2002-05-02 Thread Tor Hildrum
uug Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select * from Oslo_220602_Vika; +-+--+ | navn| epost| +---------+

CGI, submit buttons, using them as variables.

2002-04-30 Thread Tor Hildrum
First of all, I would just like to apologize for not sending this to the CGI-list, but I prefer this list. As this is where I've gotten the best help in the past. Blame yourself :) I was reading CGI.pm when I discovered that you could use the -value argument from submit buttons, and assign them t

Re: Scope of variables. Lost in subs

2002-04-08 Thread Tor Hildrum
Thanks to everyone who replied. I got enough information to solve the problem, and then some more :) Tor -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Scope of variables. Lost in subs

2002-04-08 Thread Tor Hildrum
On 8/4/02 9:15, "Tor Hildrum" <[EMAIL PROTECTED]> wrote: > Here are some of the error messages I get: > Use of uninitialized value in concatenation (.) at script.cgi line 55. > Use of uninitialized value in concatenation (.) at script.cgi line 55. > Can't open

Scope of variables. Lost in subs

2002-04-07 Thread Tor Hildrum
I have the following script: ..my $variable = ""; # Global variable, right? if (true/false) { sub3(); } elsif (true/false) { sub2(); } else { sub1(); } ## The point with this, is that sub1 is always called first, then sub2, then ## sub3. This works perfectly. sub sub1{ } sub sub2{ $vari

Re: Might be OT. Making a webpage.

2002-03-24 Thread Tor Hildrum
On 21/3/02 22:23, "Michael Kelly" <[EMAIL PROTECTED]> wrote: > What do you mean? CGI.pm seems to have a function for generating just about > every HTML that ever did, does, or will exist. Maybe I'm misunderstanding > what you mean by "Perl/CGI webpage"... I'm pretty sure it does, I'm just having

Re: creating a hash

2002-03-21 Thread Tor Hildrum
On 21/3/02 15:49, "Trice Dennis D" <[EMAIL PROTECTED]> wrote: > I'm trying to create a hash of the /etc/group file. I need the key to be > the group name and just the members of the group to be the key value. > > Has anyone done this before? > I'm guessing you know how to grab a normal hash f

Re: how to sort, in to out

2002-03-21 Thread Tor Hildrum
On 21/3/02 15:04, "David Gray" <[EMAIL PROTECTED]> wrote: >> I am trying to figure out an easy way to sort out a array of numbers: >> 2 20 38 56 75 93 -17 -35 -53 -72 -90 >> Into the following: >> -90 -72 -53 -35 -17 2 20 38 56 75 93 >> I have done the following: >> @x_step = grep { ! $x_step_

Might be OT. Making a webpage.

2002-03-21 Thread Tor Hildrum
en though there are CGI-lists, I'd rather prefer to ask on this one(feel honoured :) ). -- Tor Hildrum. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Problems with regex only matching first match on a line.

2002-03-05 Thread Tor Hildrum
#!/usr/bin/perl -w use strict; use warnings; print "What file do you want to open?\n"; chomp(my $openfile = ); print "What file do you want to write to?\n"; chomp(my $outfile = ); print "What do you want to replace in the first file?\n"; chomp(my $pattern = ); print "What do you want to replace i

Re: If (/start/ .. /end/) Flip Flop Mechanism

2002-03-02 Thread Tor Hildrum
On 2/3/02 12:06, "Steven M. Klass" <[EMAIL PROTECTED]> wrote: > Hi all > > I know there is a flip flop option but I'm not sure thats what I need.. > Here is what I want to do - and I have no idea how to do this. > > Basically I have a section of text that I am doing a search and replace > opera

Re: How do I pass a hash to a sub, and get to it in the sub?

2002-03-02 Thread Tor Hildrum
> #!/usr/bin/perl > > use strict; > > my %hash = ( > key1 => 'value 1', > key2 => 'value 2', > key3 => 'value 3', > ); > > print_hash(\%hash, '=>'); > > sub print_hash { > my ($hash, $connector) = @_; > > foreach my $key (sort keys %$hash) { > pri

Re: Dereferencing a referenced hash.

2002-02-28 Thread Tor Hildrum
> The trick is to use {$ref} where you would normally put the variable name: print "${$rhash}{1}\n"; worked like a charm :) > So $array[0] becomes ${$ref}[0] (not @$ref[0] which is a "slice"). > And $hash{key} becomes ${ref}{key}. It seems somewhat inconsistent to me. While I can dereference s

Re: Sorting a hash table - Advanced;)

2002-02-28 Thread Tor Hildrum
>> Basically I want to format this so certain keys get printed in a certain >> order, but there may be some remaining keys that I want printed that I really >> don't care about. (a "catch-all" if you will) >> >> Thanks > > print "\n\n**Summary**\n"; > foreach my $key (keys %runset){ > print "N

Re: Sorting a hash table - Advanced;)

2002-02-28 Thread Tor Hildrum
On 27/2/02 17:33, "Steven M. Klass" <[EMAIL PROTECTED]> wrote: > Hi all, > > ok here is the fundamental code > > print "\n\n**Summary**\n"; > foreach my $key (keys %runset){ > printf ( "%-20s %-20s\n",$key, $runset{$key}); > } > > Now I want to sort this hash for example > print "\n\n**Summa

Dereferencing a referenced hash.

2002-02-28 Thread Tor Hildrum
Is this a bug or a feature? Or is it just me? :) !/usr/bin/perl -w use strict; use warnings; my $variable = "variable"; my @array = qw(this is an array); my %hash = qw(1 this 2 is 3 a 4 hash); ## correct syntax my $rvariable = \$variable; my $rhash = \%hash; ## correct syntax my $rarray = \@ar

Re: Matching

2002-02-27 Thread Tor Hildrum
>> On 27/2/02 13:11, "Jon Molin" <[EMAIL PROTECTED]> wrote: >> >> >> Hi, >> >> I was wondering if any one can help me. Is there any command in perl that >> will let me match a line only if the next line >> fufills a certain condition, without doing a double loop over the file? >> My data is lik

Re: Matching

2002-02-27 Thread Tor Hildrum
On 27/2/02 13:11, "Jon Molin" <[EMAIL PROTECTED]> wrote: > Iain Wallace wrote: >> >> Hi, >> >> I was wondering if any one can help me. Is there any command in perl that >> will let me match a line only if the next line >> fufills a certain condition, without doing a double loop over the file? >

Understanding Perl better.

2002-02-16 Thread Tor Hildrum
I have 2 questions. Here is the code: #!/usr/bin/perl use warnings; use strict; # Merging two files print ("Write the two files you wan't to merge and \n"); print ("lastly the file to merge them too, seperated by a space.\n"); chop (my $filenames = ); my @names = split(/ /,$filenames); # Get t