<?xml version="1.0" encoding="windows-1252"?>
<node id="719680" title="Re^3: Return full line from line number X" created="2008-10-26 20:47:05" updated="2008-10-26 20:47:05">
<type id="11">
note</type>
<author id="99151">
krusty</author>
<data>
<field name="doctext">
Perhaps you could show us a few lines from the file to give us a sample?  So what you are saying is that the number you are looking for is more like an id number or phone number than a line number?  So that when you say "the line number will be used to pull the line" you perhaps mean something more like the "phone number", to use your example?&lt;BR&gt;&lt;BR&gt;

If there are no repeats of the line number you want from anywhere else in the file, then perhaps the following:&lt;BR&gt;
&lt;CODE&gt;
undef $/; 
my $number = 42; 
#or $number = $ARGV[0] or whatever line number you were looking for
my $file = &lt;FILE&gt;;
my ($line, $name); 
# ($line) = $file =~ /$($number\s+.*)/m;
# would store the whole line 

($number, $name) = $file =~ /$($number)\s+(.*)/m;

# use the second form since you just want number and name
# and yes, you are overwriting the value of $number
# with itself all over again.  Use (undef, $name) = $file...
# if that makes you feel more comfortable.
&lt;/CODE&gt;
</field>
<field name="root_node">
719673</field>
<field name="parent_node">
719678</field>
</data>
</node>
