I have to start somewhere,
This works:
print "Enter your name: ";
$text = ;
print "\nHello $text\n";
print "Please enter your password: ";
$password = ;
if ($password == 21)
{
print"Correct\n";
}
else
On Nov 16, Rex Arul said:
>C:\WINDOWS>perldoc -f Cwd
>No documentation for perl function `Cwd' found
perldoc -f Cwd is not the same as perldoc Cwd.
There is a standard module, Cwd.pm, that gives you a cwd() function.
>From: "Michael Fowler" <[EMAIL PROTECTED]>
>
>> On Fri, Nov 16, 2001 at 05:2
This is what I get. Is there a function Cwd?
C:\WINDOWS>perldoc -f Cwd
No documentation for perl function `Cwd' found
- Original Message -
From: "Michael Fowler" <[EMAIL PROTECTED]>
To: "Pradeep Sethi" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 8:34 PM
On Fri, Nov 16, 2001 at 05:23:19PM -0800, Pradeep Sethi wrote:
> what is the function in perl that returns current dir ?
see perldoc Cwd
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
--
To unsubscribe, e-mail: [EMAIL PR
I am on unix
I am doing this :
my $dir=`pwd`;
but I was looking, if there is a function in perl.
> -Original Message-
> From: Rex Arul [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 5:36 PM
> To: Pradeep Sethi; [EMAIL PROTECTED]
> Subject: Re: get current dir
>
>
>
>
Quick Reply: If you are in Windows OS, this would work:
perl -e "use Win32; print Win32::GetCwd();"
- Original Message -
From: "Pradeep Sethi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 16, 2001 8:23 PM
Subject: get current dir
> what is the function in perl
what is the function in perl that returns current dir ?
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I have 10 scripts and they all have variable
$phone_number=(XXX);
I need to made module that will efect all scripts to use the value from that
variable.
How can I do that?
Thanks
Alen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Here is what I wrote for two non-identical...
@letters=split(//, $input);
for $a(0..$#letters)
{
if ($letters[$a] ne $letters[$a+1] && $letters[$a] =~ /[A-Z]/ &&
$letters[$a+1] =~ /[A-Z]/)
{
print $input;
last;
}
}
Agustin
- Original Message -
From:
On Thu, Nov 15, 2001 at 05:22:26PM -0800, Curtis Poe wrote:
> --- Sidharth Malhotra <[EMAIL PROTECTED]> wrote:
> > While were on this, I'm taking an intro to Data Structures class and
> > were learning all about the different sorting methods ... Insertsort,
> > mergesort etc. What kind of sorting
but ABBC displays as valid!
Wags ;)
-Original Message-
From: John W. Krahn [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 14:56
To: [EMAIL PROTECTED]
Subject: Re: capture strings with two non-identical capital letters in a
row
Birgit Kellner wrote:
>
> How can I fi
Birgit Kellner wrote:
>
> How can I filter out strings which contain two (or three) non-identical
> capital letters in a row?
>
> my $string1 = "ABCD";
> my $string2 = "AbCd";
> my $string3 = "AABcD";
>
> Get $string1, discard $string2 and $string2.
This will work on the data provided:
while
On Fri, 16 Nov 2001, KeN ClarK wrote:
> I want to capture the title of the current song I have running on my box
> through mpg123 and redirect it to a file. In this process, I don't want
> the /long/path/to/song but just the song.mp3. Is it possible to capture
> the song title this way?
>
> Ken
On Thu, Nov 15, 2001 at 06:19:19PM +, Jon Topper wrote:
> Hi,
>
> Probably utterly the wrong place to ask this question, but there were
> so many lists to choose from I was going dizzy just reading them!
>
> I'm working on a project which involves the embedding of a number of
> perl interpr
Here is a shot using both regex and a for loop:
sub checker {
local $_ = $_[0]; # pass the data to be checked
return 0 if ( /[^A-Z]/ ); # if not capital letters, get out
my $MyResult = 1;
my @worka = split(//,$_); # split out all the ch
Rietsch Thierry [[EMAIL PROTECTED]] quoth:
*>Hello
*>How can I deinstall a Modul, which I install before with CPAN?
You use ExtUtils::Installed to name the files and then delete them.
#!/usr/local/bin/perl
use ExtUtils::Installed;
my ($inst) = ExtUtils::Installed->new();
my $module = "Date::Chri
Hi
I've been trying unsuccessfully to create a new array with similar items ie
$array[0], $array[3], $array[4] based on "apples"
Help appreciated.
Regards
Clinton
My code so far:-
use strict;
my @array;
$array[0] = ["apples","oranges","plums","1"];
$array[1] = ["asparagus", "corn","peas","1"];
$a
On Nov 16, Pete Emerson said:
>Multidimensional syntax $table[substr $_, $i, 1] not supported at ./sort3.pl line 31.
That's bizarre.
$table[substr($_, $i, 1)]
might fix that.
>and when I turn on strict:
Gah. I've got working code on PerlMonks.org, with the name "IP Address
Sorting".
--
How can I filter out strings which contain two (or three) non-identical
capital letters in a row?
my $string1 = "ABCD";
my $string2 = "AbCd";
my $string3 = "AABcD";
Get $string1, discard $string2 and $string2.
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comma
Here are two approaches:
1) Make sure that every record in the log file includes a
timestamp. Parse all lines, locate the first timestamp that is
>= (CT - 1 hour), using everything after that line.
2) Rename the log file every hour so that you start 24 separate
logs each day, an
On Fri, 16 Nov 2001, Tomasi, Chuck wrote:
> Good point. I should be a little more imaginative. Sometimes making up
> meaningful variable and function names is the hardest part of writing code.
It is indeed!
> Another thing I found about the references, the order of the parameters
>
my @fileNames = (".","..",1,2,3,4,5,6,7,8,9); #assuming that's what the
readdir gives.
splice (@fileNames,0,2); #removes the . and ..
foreach(@fileNames){
if (!-e $_){
print "Sending missing for file: $_";
sendMissing($_); pause();
}
}
I'm not sure we can use the !-e (-e test existe
Etienne Marcotte <[EMAIL PROTECTED]> writes:
> I have a webpage where a user logs in to get administrative options.
> The main admin page directs to different sections (perl scripts) for
> different table manipulations of the database [...]
>
> What are your comments regarding those methods / do
Sorry for the late reply, but the rules for CGI are pretty simple concerning
this and using a bulky module such as CGI for something simple may not be the optimum
path for your needs.
Basically, you can think of the url as the commnad line, with the full "path"
to your command
Okay, so I'm trying to implement your radix sort, and something's going wrong.
When I turn on warnings (I'm using Perl v5.6.0) I get:
Multidimensional syntax $table[substr $_, $i, 1] not supported at ./sort3.pl line 31.
and when I turn on strict:
Can't use an undefined value as an ARRAY reference
On Friday 16 November 2001 01:36 pm, Etienne Marcotte rambled:
> > for(my $i = 2, my $j = 1; $i <= $last;$i++, $j++) {
> > if ($j ne $fileNames[$i]) {
> > print "Sending missing for file: $fileNames[$i]";
> > &sendMissing($j);
> > &pause;
> > next;
> > }
>
If you mean can I get only the filename, yes. You could use File::Basename or
use something like this:
$filename= '/a/b/c/d/e/song.mp3'; # hold your fully qualified f
$filename=~ s/^.+[\\\/]//;
# now holds song.mp3
I use this for display purposes of the script
> 1.Shutdown the WWW publishing services and disable the service.
Use Win32 module and Win32::Service module.
>
> 2.Shutdown a COM+Application
Use Win32 Module and use GetActiveObject or just Win32::OLE->new methods
-- Rex
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comm
I want to capture the title of the current song I have running on my box
through mpg123 and redirect it to a file. In this process, I don't want
the /long/path/to/song but just the song.mp3. Is it possible to capture
the song title this way?
Ken
_
[EMAIL PROTECTED]
use CGI;
my $q = new CGI;
$q->import_names('IN');
it gets the values from the web form.
{e}
Gibbs Tanton - tgibbs wrote:
>
> I was looking more for something like
>
> $UsrPass = <>;
>
> or something like that...where do you assign to the variable IN::UsrPass?
>
> -Original Message-
I was looking more for something like
$UsrPass = <>;
or something like that...where do you assign to the variable IN::UsrPass?
-Original Message-
From: Etienne Marcotte
To: Gibbs Tanton - tgibbs
Cc: '[EMAIL PROTECTED] '
Sent: 11/16/2001 12:10 PM
Subject: Re: Need help with an error
sub
Pete Emerson wrote:
>
> Dave Storrs wrote:
>
> > Hmmm...this is interesting. A friend of mine who is in the
> > process of getting her graduate degree in CS/information theory stuff
> > recently told me that it has been mathematically proven that no sort can
> > run faster than O(n log
What is the key to your hash: UserID. Then you would use the UserId value as
the key and either setup something like:
$hash{$userid}[0] - support id
$hash{$userid}[1] - Assigned to
$hash{$userid}[2] - DateOpened
I also like the -> when doing the work from a ref:
> for(my $i = 2, my $j = 1; $i <= $last;$i++, $j++) {
> if ($j ne $fileNames[$i]) {
> print "Sending missing for file: $fileNames[$i]";
> &sendMissing($j);
> &pause;
> next;
> }
You never close the opening bracket in the if statement.
and your for is not
Dave Storrs wrote:
> Hmmm...this is interesting. A friend of mine who is in the
> process of getting her graduate degree in CS/information theory stuff
> recently told me that it has been mathematically proven that no sort can
> run faster than O(n log n) unless you know something about
I've rewritten the algorithm, but it still is not working correctly. Files 1,
2, 3, 4, 5 are all present, 6 and 7 are missing and 8 is present.
When it gets to the first missing file (6) it skips right over 6 and 7
without running the code in the if statement, but then runs the if statement
co
sub auth_user{
my ($dbh,$user,$pass) = @_;
my $sth = $dbh->prepare("SELECT usrID, usrPass, usrDjID, usrAcc from
users where usrNick like ?");
$sth->execute($user);
my ($dbid, $dbpass, $dbusrid, $dbacc) = $sth->fetchrow_array;
$sth->finish;
($pass eq $dbpass) ? return ($dbid, $dbusrid, $dbacc) : re
I guess the major question is does IN::UsrPass ever get anything assigned to
it? I see where you pass it in, but where does it get assigned?
-Original Message-
From: Etienne Marcotte
To: [EMAIL PROTECTED]
Sent: 11/16/2001 11:56 AM
Subject: Need help with an error
[Fri Nov 16 12:37:44 2
[Fri Nov 16 12:37:44 2001] [error] [client 127.0.0.1] Name "IN::UsrPass"
used only once: possible typo at
c:\PROGRA~1\APACHE~1\apache\cgi-bin\USER_H~1.PL line 18.
17 sub auth_user{
18 my ($usrID,$usrDjID,$usrAcc) =
inc::db::auth_user($dbh,$IN::UsrNick,$IN::UsrPass);
19 ($usrID) ? main_page($IN::U
Good point. I should be a little more imaginative. Sometimes making up
meaningful variable and function names is the hardest part of writing code.
Another thing I found about the references, the order of the parameters
matter. If I pass the array ref first and the hash ref second, the
foreach(
Bob Showalter [[EMAIL PROTECTED]] quoth:
*>
*>require() is handy inside an eval { } block to trap whether a module
*>is installed or not. Many CPAN modules use this technique.
Like I said, I can't think of any good reasons for using require.
e.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
I have a webpage where a user logs in to get administrative options.
The main admin page directs to different sections (perl scripts) for
different table manipulations of the database [...]
What are your comments regarding those methods / do you suggest
something else $ which one would you use /
> > In practical daily use, use(); is preferred as since it compiles the
> > module as soon as it sees 'use Foo::Bar;' before moving on, this will
> > catch errors and scope conflicts far sooner than if you use require();
> > There aren't many good reasons to use require, at least I
> > can't thin
This may or may not solve your problem, but
Name your sub something other than 'ref'. Ref is a reserved word in Perl.
(perldoc -f ref for details on what it does)
Dave
> > > --arg.pl---
> > > #/usr/plx/bin/perl -w
> > >
> > > use strict;
> > >
> > > sub ref
> > > {
>
Hash is being populated in the sub, but when I tried accessing the values
after calling &ref(), it appeared as they they weren't there.
I must have done something silly that I cannot reproduce. Once I stepped
through the debugging and saw that %hash had the right values, I wrote
another foreach(
On Fri, 16 Nov 2001, Pete Emerson wrote:
> I got this from http://www.wikipedia.com/wiki/Radix_sort:
>
> QUOTE
> Radix sort is a sort algorithm that operates in O(n) time. This algorithm was
> orignally
> used to sort punched cards in several passes. It has resurfaced as an
> alternative to
> o
Hi,
How can I pull data from a log file for last hour or so
I wrote a script but i am unable develop a logic for last one hour
My script is reading the data fine line by line or last 10 or 20 lines
But it is not what I want
I want whatever is current time minus one hour or so
If some one can he
> -Original Message-
> From: Tomasi, Chuck [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 12:16 PM
> To: 'Bob Showalter'; '[EMAIL PROTECTED]'
> Subject: RE: Populating a referenced hash
>
>
> > Your sub looks ok, but of course we can't tell if any of
> > the regexes are act
Again...I have no idea how to do this in PERL either. The best way I
know how to do it, is to write a registry .inf and apply the changes
with secedit.
-_-aaron
-Original Message-
From: Veeraraju_Mareddi [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 2:45 AM
To: [EMAIL PROTE
--sorry if this seems way out of sorts ...
--i've only worked with DHCP a few times a
few years back, but ... on the DHCP server
when you list a range of IP addresses that
are available, doesn't it keep a log
of what ip <=> mac addresses that asking
for it?
--i think it's the same with Unix ...
> Your sub looks ok, but of course we can't tell if any of
> the regexes are actually matching.
The regexes are matching. I put a quick forech() loop to print out the keys
and their values. Everything looks OK at the end of the sub.
> Instead of ${$href}{'UserID'}, which is valid syntax, the
>
Hi,
I am trying to write a perl script.
I need some help to achieve the following tasks from Windows 2000 command
prompt:
1.Shutdown the WWW publishing services and disable the service.
2.Shutdown a COM+Application
3.Go to components folder and delete all the Components.
4.Get all the latest
You'll want to write a registry .inf file with the proper permissions
for the key. You can then use secedit.exe to apply the proper changes
to the keys.
-_-Aaron
-Original Message-
From: Veeraraju_Mareddi [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 15, 2001 11:35 PM
To: [EMAIL P
> -Original Message-
> From: Tomasi, Chuck [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 11:54 AM
> To: 'Wagner-David'; '[EMAIL PROTECTED]'
> Subject: RE: Populating a referenced hash
>
>
> My mistake on $hash{'$UserID'}. I found that and fixed it
> shortly after
> sendi
[EMAIL PROTECTED] wrote on 16 Nov 2001:
> What I want to do is scroll thru the file and when it finds the line
> that starts with "NC00" print that line and the next 5 lines.
Here's one way:
while () {
next unless /^NC00/;
print;
$_ = , print for 1..5;
}
--
David Wall
[EMAIL PROTE
If it is DHCP, you are going to want to collect more than just the IP
from the user. The IP is not uniquely identifiable in a DHCP situation.
You may want to collect such info as the MAC address as well. Are you
storing this in a flat file, or some kind of db?
-_-Aaron
-Original Message---
$arrayref seems okay
assuming that $prod is an array ref it should be
$prod->[0] * $prod->[1]
On Fri, Nov 16, 2001 at 11:52:49AM -0500, AMORE,JUAN (HP-Roseville,ex1) shaped the
electrons to read:
>
>
> > Hello,
> > Do I have the below dereferencing correct.
> > I a anonymous array and I'm tryi
My mistake on $hash{'$UserID'}. I found that and fixed it shortly after
sending the message, but it still doesn't allow me to populate the hash with
values.
If I were doing this in C, I'd send a structure pointer to the sub/function
and get back a the various populated fields.
I saw this done a
> Hello,
> Do I have the below dereferencing correct.
> I a anonymous array and I'm trying to multiply
> the "1" & "2" using the arrow notation:
>
>$arrayref = [ 1,2, ['x','y','z']];
>
> $prod -> [0] * [1];
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
howabout
while () {
next unless /^NC00/;
push @required , $_;
}
On Fri, Nov 16, 2001 at 03:42:59PM -0500, [EMAIL PROTECTED] shaped the
electrons to read:
> Hello All,
> This appears to be quite simple, but yet the answer has eluded me.
> I can/kow how to use a foreach loop to
Your print using:
print "User ID = $hash{'$UserID'}\n";
will use $UserID, but there is no such thing.
In your sub, you are allowing only one value per assignment, ie your keys are
UserID, AssignedTo, etc and there will be only one value. If you want multiple
val
One way (probably not the most elegant)
set a flag variable to 0
my $flagv=0
foreach to read file
{
$flag=1 if (/^NC00/);
if ($flag)
{
store line
increment counter
if counter >5 $flag=0
}
--
Chris D. Garringer
LAN/WAN Supervisor
Toshiba International
713-466-0277 x
Hello All,
This appears to be quite simple, but yet the answer has eluded me.
I can/kow how to use a foreach loop to pull one line from a file. But what
I am trying to do is this.
I have a file that has about 200 lines of junk and about 10 lines that I
really
need. Some thing that looks like t
Atlanta, Georgia
-Original Message-
From: Etienne Marcotte [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 10:08 AM
To: [EMAIL PROTECTED]
Subject: Off-Topic (200%) - Where are you from?
By reading the messages everyday I can guess most of us are from United
States right? And
$ENV{REMOTE_USER}
This will require defining your web server (Apache, IIS, whatever) to
require authentication when connecting to a particular page in order to get
a valid name. I'm not sure you can get a valid username without
implementing the server's security functions, whatever form they are
Hello
How can I deinstall a Modul, which I install before with CPAN?
Mfg
Thierry
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi,
i'm using a CPAN module (pop3client), my problem is the .
In this module a can active the debug and it goes on , thet is
for defalt displayed on terminal.
Is possible to redirect the on a variable, and not displayed on
the terminal.
whene a message goes at i don't want see on monitor
hun?
Well if you set a cookie you can read it, but else, you have to "read"
somewhere the user info!
Etienne
Goessnitzer Nicolas wrote:
>
> Hi all !
> I try to build a Web-DBMS,
> and I would like to get the username of a person making a new entry.
> Is there a possibility of getting the usern
See the attached script. It's a logon script I wrote a while ago in Perl. It
was compiled and run as an exe using Perl2Exe. Not the greatest script, but
should get you started... I've just looked back on it and seen *so* many
ways it could be improved. Ho hum.
John
-Original Message-
F
Hi all !
I try to build a Web-DBMS,
and I would like to get the username of a person making a new entry.
Is there a possibility of getting the username (in the WWW) with(/out) login
?
Is there an environmentvariable which chatches this ?
Thanks,
Nicolas
--
To unsubscribe, e-mail: [EMAIL PROTEC
> -Original Message-
> From: Elaine -HFB- Ashton [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 10:28 AM
> To: [EMAIL PROTECTED]
> Cc: Ray Murphy; [EMAIL PROTECTED]
> Subject: Re: Modules
>
>
> Jeff 'japhy' Pinyan [[EMAIL PROTECTED]] quoth:
> *>On Nov 16, Ray Murphy said:
>
Jeff 'japhy' Pinyan [[EMAIL PROTECTED]] quoth:
*>On Nov 16, Ray Murphy said:
*>
*>>When using modules, is it better to say 'use
*>>Foo::Bar;' rather than 'require'. Also I've noticed
*>>that some people put their 'use' or 'require'
*>>statements in subroutines and not at the beginning of
*>>the p
Perl: 5.6.0
OS: Solaris 7
Goal: Scan a text file for key words/values and populate a hash
My parsing works, but the main() never sees the values properly. If I'm
passing by reference, why isn't the hash I passed getting populated in the
main namespace?
Thanks
--Chuck
--arg.pl-
> -Original Message-
> From: Jorge Goncalvez [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 4:34 AM
> To: [EMAIL PROTECTED]
> Subject: RE:Kill a process
>
>
> Hi, I wonder how can I know if a process for exemple dhcpd is
> running and if it
> is how can I kill it in Perl.
You know, this sounds awfully like the question "Sherri" asked a couple of
days ago... See the below thread.
-Original Message-
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: 15 November 2001 11:51
To: 'Sherri'; [EMAIL PROTECTED]
Subject: RE: Help with PERL
See the list FAQ. Sectio
OK, I've been lurking long enough. Got what I think is a very simple
question which may be more of an NT command shell question as it is a Perl
question.
I have a very simple script (below) which reads data from STDIN and converts
the supposed EBCDIC hex data to readable text (yes, I'm a mainfram
Jeff 'japhy' Pinyan wrote:
> Ooh, radix sort. This is a cool technique, but it has a drawback: it
> always runs in the same time. Sorting sorted data takes as long as
> sorting UNsorted data. (Or sordid data!)
I love the implementation, gotta examine it closely and your example by hand
with
For my second post here, a Perl Win32 question:
I want to use Perl instead of Kix32 for our logonscripts.
Something I haven't found out yet is how to do this in Perl:
if member of "accounting" then net use i: \\server\accounting
where accounting is a group in the NT-domain.
And on a more construct
Try http://www.wellho.net
Good price and great training, have used them myself.
John Moylan
-Original Message-
From: PURMONEN, Joni [mailto:[EMAIL PROTECTED]]
Sent: 13 November 2001 09:36
To: [EMAIL PROTECTED]
Subject: recommended perl training in UK?
Hi all,
This is probably the nic
Jeff 'Japhy' Pinyan wrote:
>
> Bubble sort is a naive sorting algorithm. It's called "bubble" sort
> because the larger elements "rise" to the "top" of the list, like a bubble
dang, that's the best explanation i've seen. thanks. mind if i use it
when explaining it to my duhvelopers?;-)
On Nov 16, Pete Emerson said:
>Since we're on the topic of sorts, what are the arguments for
>the implemented quicksort vs. a radix sort?
(Perl now uses some mergesort hybrid.)
Ooh, radix sort. This is a cool technique, but it has a drawback: it
always runs in the same time. Sorting sorted d
Jonathan Vandine wrote:
>
> I am trying to pass to hashes to a subroutine and combine into one hash.
> Then return that hash as a reference to the main program. Then print the
> result of new hash.
>
> %h1 = ("key1" => value1);
> %h2 = ("key2" => value2);
> $rnew = &mergehash(\%h1, \%h2)
Since we're on the topic of sorts, what are the arguments for
the implemented quicksort vs. a radix sort?
Pete
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Nov 16, Sherri said:
>Please tell me if this is the correct program for making attribute
>codes. In this program I need to do like a form with an employee's name,
>age, position and start date. This is the way I wrote it. Please tell me
>what is missing or incorrect.
Most people would use a h
On Nov 16, jonathan vandine said:
>%h1= ("key1" => value1);
>%h2= ("key2" => value2);
>$rnew = &mergehash(\%h1, \%h2);
> sub mergehash{
> %h3 = @_;
Here, %h3 consists of ONE key and ONE value -- the key is \%h1, and the
value is \%h2.
Merging hashes is probably too m
On Nov 16, Ray Murphy said:
>When using modules, is it better to say 'use
>Foo::Bar;' rather than 'require'. Also I've noticed
>that some people put their 'use' or 'require'
>statements in subroutines and not at the beginning of
>the program - what benefits does this serve - conserve
>memory bec
I am trying to pass to hashes to a subroutine and combine into one hash.
Then return that hash as a reference to the main program. Then print the
result of new hash.
%h1 = ("key1" => value1);
%h2 = ("key2" => value2);
$rnew = &mergehash(\%h1, \%h2);
sub mergehash{
I might be wrong here but use and require both do basically the same thing ...
they check to see if the module has been included before and if it has not
then it reads it in. the difference is in the usage ... require takes a
complete path to the actual module file and use just takes the module n
Hello,
When using modules, is it better to say 'use
Foo::Bar;' rather than 'require'. Also I've noticed
that some people put their 'use' or 'require'
statements in subroutines and not at the beginning of
the program - what benefits does this serve - conserve
memory because as soon as you've left
Andrea Holstein wrote:
>
> "John W. Krahn" wrote:
>
> > That looks like a direct translation of algorithm 5.2.2B from TAoCP Vol.
> > 3 however the usual implementation is more like Sedgewick's example:
> >
> > sub bubble {
> > my $a = shift;
> >
> > for ( my $i = @$a; $i >= 1; $i-- ) {
>
Glenn Cannon wrote:
>
> Thx japhy,
>
> Does exactly what I need it to.
>
> Now all I need is a way to work out the last day of the month. Most of them
> should be easy, but that damn February...
>
It's always the best using an already existing module.
E.g. Date::Calc:
use Date::Calc qw(Days_
"John W. Krahn" wrote:
> That looks like a direct translation of algorithm 5.2.2B from TAoCP Vol.
> 3 however the usual implementation is more like Sedgewick's example:
>
> sub bubble {
> my $a = shift;
>
> for ( my $i = @$a; $i >= 1; $i-- ) {
> for ( my $j = 2; $j <= $i; $j++ )
"Merrychristmas!" wrote:
>
> 1.@array = qw ( hello world hello how are you );
> 2.$match = 'HEllo';
> 3.print "Your search for $match returns $subroutine $count
> records\n";
>
> $subroutine = &count;
> sub count {
> foreach $record (@array){
> if (grep /$ma
i am from india too
/kk
On Fri, Nov 16, 2001 at 09:21:11PM +0530, Kilaru Sambaiah wrote:
>
> Hi,
>
>I am from Chennai city located in India.
>
> regards,
> Sambaiah Kilaru
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
To un
Sherri wrote:
>
> What does the promote function do?
$ perldoc -f promote
No documentation for perl function `promote' found
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
What does the promote function do?
[EMAIL PROTECTED] wrote:
>
> On Fri, Nov 16, 2001 at 06:00:42AM -0500, Sherri shaped the electrons to read:
> >
> > Please tell me if this is the correct program for making attribute codes. In this
>program I need to do like a form with an employee's name, age, position and start
>date. This is
Actually what you really need is a hash not an array ...
%employee = ( 'name'=>'John Doe' , 'age'=>32 , 'position'=>'SE' ,
'start_date'=>'10/12/2000' );
for my $field (%employee) {
print "$field: ", $employee{$field} , "\n";
}
On Fri, Nov 16, 2001 at 06:00:42AM -0500, Sherri shaped the
Please tell me if this is the correct program for making attribute codes. In this
program I need to do like a form with an employee's name, age, position and start
date. This is the way I wrote it. Please tell me what is missing or incorrect.
#!/usr/bin/perl -w
use strict;
$name_field = 0; $age
> Thanks Cripps & Members,
> What should be the way to simplify the undermentioned working code as Part 1
> and part 2 are repetition.
Actually they aren't. Look at them and see. :-)
It's late here. It might be late where you are too.
That makes things that are different look alike sometimes.
1 - 100 of 114 matches
Mail list logo