What will happen in your code is that you will get the first line of "hual" and then read through all the lines of "land" then when you get the second line of "hual" there will be no more lines from "land" to search through because the file pointer for that handle will be at the end of the file. Try this to see what I mean:
Side note: use all uppercase characters for filehandles or better use lexical filehandles. lower-case words should be avoided in perl since all of perls built-in functions are all lower-case.
If you need to start the search in "land" from the beginning of the file for each line of "haul" you can use seek() to return the file pointer back to the beginning of the "land" file. See seek() for details.
hi,
how would i go about making a loop which gets each line from a single text file, set it to a variable and then print it to screen?
thanks
eg:
#!/bin/sh
FILE="somefile.txt"
text_line=""
what kind of loop would use here? (18 Replies)
while
do
print What is the next device number to be added to $dgroup?
print Press \<Enter\> if there are no more devices to be added.
read dev_num
export dev_num
symld -g $dgroup -sid $sname add dev $dev_num
done
In this while... (2 Replies)
I need to process a file line-by-line using some value from a shell variable
Something like:perl -p -e 's/$shell_srch/$shell_replace/g' input.txt
I can't make the '-s' work in the '-p' or '-n' input loop (or couldn't find a syntaxis.)
I have searched and found... (4 Replies)
Hi all
Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
hey guys what im trying to do is do a simple script that will ask for a password and on the 5th time it says access denied if the right password is still not entered this is what i have so far can anyone help me im not good with scripting
thanks in advance
#!/bin/bash
secretname=secret... (2 Replies)
I am struggling with the for loop. I have a file name heros.txt and I would like to go through a list in file where.txt and see if I can find the name from where inside heros.
One of the problems that I am having is I dont understand how to setup the for loop to find the list to search.:wall:
... (6 Replies)
Hi,
I'm trying to put together a small script that will read a txt file that contains a list of two columns. Each column is the name of a folder..
e.g.
AIX Server1
AIX Server2
AIX Server3
$ for i in `cat /opt/apacheprod/scripts/input/copy_list.txt`
do
PLATFORMVAR=`awk ' { print $1 } '... (7 Replies)
I have two files. In file one, there are many columns, but only two of interest to me. Column 1 contains a list of individuals, defined by an ID number. Column 10 contains the diagnosis that each individual has (I am a physician). All together, there are 3000 lines in this file, one line per... (2 Replies)
Hi,
I have code like below
disk_list=$(ls /root/file1)
for disk in $disk_list
do
pvcreate $i
done
I know what pvcreate command does, but I do not understand what this $i do here. can someone please explain. (2 Replies)
Hi,
I have a variable called result that get the the below value i.e two lines assigned../logs/mymac/myserver.log:####<Jun 7, 2015 12:56:54 PM EDT> <myserver.my.bank.com> <mymac> < ExecuteThread: '5' for queue:\
'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <1434640> <BEA-0900>... (0 Replies)
Discussion started by: shifahim
0 Replies
LEARN ABOUT DEBIAN
net::openid::extension
Net::OpenID::Extension(3pm) User Contributed Perl Documentation Net::OpenID::Extension(3pm)NAME
Net::OpenID::Extension - Base class for OpenID extensions
VERSION
version 1.14
METHODS
CLASS->namespace_uris
Return a hashref mapping namespace URIs to the aliases you will use to refer to them in the other methods. For example:
return {
'http://example.com/some-extension' => 'someext',
};
CLASS->new_request(@parameters)
When your extension is added to the Net::OpenID::ClaimedIdentity object in consumer-land, this method will be called to create a request
object. Any additional arguments passed when adding the extension will be passed through verbatim in @parameters.
The object you return here should at minimum provide the interface defined in Net::OpenID::ExtensionMessage.
You can return "undef" here if you have nothing useful to return.
CLASS->received_request(\%args)
In server-land, when a caller asks for the request object for your extension this method will be called to create a request object. %args
maps the aliases you returned from the "namespace_uris" method to a hashref of the key-value pairs provided in that namespace.
The object you return here should at minimum provide the interface defined in Net::OpenID::ExtensionMessage, and should behave identically
to the corresponding object returned from "new_request".
You can return "undef" here if you have nothing useful to return.
CLASS->new_response(@parameters)
When your extension is added to the response in server-land, this method will be called to create a response object. Any additional
arguments passed when adding the extension will be passed through verbatim in @parameters.
You can return "undef" here if you have nothing useful to return.
CLASS->received_response(\%args)
In consumer-land, when a caller asks for the request object for your extension in Net::OpenID::VerifiedIdentity this method will be called
to create a response object. %args maps the aliases you returned from the "namespace_uris" method to a hashref of the key-value pairs
provided in that namespace.
You can return "undef" here if you have nothing useful to return.
perl v5.12.4 2011-11-11 Net::OpenID::Extension(3pm)