In the below example you are saying if $gimp equals "gimp" or if "gimps".
The First part of the if is actually testing values while the second part
of the if statement is always true... therefore always printing working.
you could try
if ($gimp =~ /gimp/)
{
print "working";
}
The
The dollar signs tells the subroutine how many arguments you are passing to
the subroutine. Each $ is an argument. In the example you provided it will
accept 2 arguments passed to it.
"The right word may be effective, but no word was ever as effective as a
rightly timed pause."
This works but does anyone have any ideas on the previous question?
while( )
{
$line=$_;
chomp($line);
@list=split(/:/,$line);
$account_key=$list[0];
$account=join ":",@list;
$record{$account_key}=$account;
}
I am trying to split
I am trying to split off the user name and the password record in one pass
through however what I am getting is only the first record is being
populated into my user array.
Can someone tell me am I going about this the right way?
Thanks,
Royce
my @user=(split(/:/,(@passwd=(split(/\n/,`cat /etc
You could also do something like this.
foreach $uid (%file1)
{
if ( ($file1{$uid} =~ /$file2{$uid}/) || ($file2{$uid} =~ $file1
{$uid}))
{
print "A duplicate has been located\n";
}
}
"The right word may be effective, but no word was ever as effective as a
right
Try
printf FILEHANDLE, "Message";
"The right word may be effective, but no word was ever as effective as a
rightly timed pause."
--Mark Twain
try
my ($a,$b)=("apples","apples");
In the other example it was pulling values from an array of scalars.
In your example you are only providing 1 scalar for 2 scalar variables to
share.
Royce
"The right word may be effective, but no word was ever as effective as a
rightly timed pause."
Shouldn't you only set the values of the array once you have gone through
the entire file? Otherwise You keep rewriting your hash.
%linehash = @line;
"The right word may be effective, but no word was ever as effective as a
rightly timed pause."
--Mark Twai
actually it gives you an error :)
You misspelled variable!
You made a boo...boo
I know bad Halloween humor
If you set the examples...
you don't have to set the rules
Royce Wells
Unix Systems Engineer
let's suppose
$variable = "som
It's no perl but it could work : )
make sure you start in the directory with the .doc files
ls -1 *.doc | awk -F. '{printf("cp %s.doc /my/newpath/%s.data\n",$1,$1)}'|
/bin/ksh
There is also Crypt::TripleDES that you might find useful.
"The software said it required Windows 3.1 or better so I installed Linux.
"
Royce Wells
Unix Systems Engineer
Dept # 8023
123 S. Front St.
Memphis, TN 38103-2905
Phone: (901)495-7538
Fax: (90
memphis tn
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
make sure you are also getting rid of tabs
$var=~s/\t*^//g
"The software said it required Windows 3.1 or better so I installed Linux.
"
Royce Wells
Unix Systems Engineer
Dept # 8023
103 S. Front St.
Memphis, TN 38101
Phone: (901)495-7538
Fax: (90
[1,6,8..-1]
in this case "-" is seen as a metacharacter inside the character class and
is not seen as -1
Hi,
I have an unnamed array which I created from splitting up a colon separated
string:
$_ = "0th:1st:2nd:3rd:4th:5th:6th:7th:Some random text: might have
:colons: or might n
I am working on a program that prints out script varibles to an html. When
I run it from the command line I see the variable. When the web page
(cgi-script runs) it eats them and just prints blank lines. An example
follows.
# this works
$ID=`id`
print "$ID"
#this doesnt
$STORE=`store_output.x o
can we have that in writing account number 4567 7890 1234 5678
ok so thats not a real credit card but zero mine out just for the
laughs?
"Kipp, James
goal"
--Henry Ford
Royce Wells
Unix Systems Engineer
Dept # 8023
103 S. Front St.
Memphis, TN 38101
Phone: (901)495-7538
Fax: (901)495-3300
---
The information transmitted i
17 matches
Mail list logo