You don't see any problems here?
$i = 0;
my $filename2 = "invaildAddress";
$arrayLength = scalar(@addressSave);
print $arrayLength ."\n";
open(IN2 , '>', $filename2);
print IN "Invalid Addresses:\n\n\n";
while($i > $addressL){
##########BROKE?
print IN2 "City = " . $invalidAdd[$i]->{City} . "\n";
print IN2 "State = " . $invalidAdd[$i]->{State} . "\n";
print IN2 "Zip = " . $invalidAdd[$i]->{Zip} . "\n";
print IN2 "Address = " . $invalidAdd[$i]->{Address} . "\n";
print IN2 "Po Box = " . $invalidAdd[$i]->{PoBox} . "\n";
print IN2 "Suite = " . $invalidAdd[$i]->{Suite} . "\n";
print IN2 "Misc data = " . $invalidAdd[$i]->{MiscData} . "\n\n";
$i++;
}
close(IN2);
First you set $i to 0. Then you open a file with the handle "IN2" for output, but fail to check open for success. Then you print a line to the closed filehandle named "IN". Then you have a while loop that never executes because $i still holds zero, which should never be greater than $addressL. Since the only lines that print to IN2 are inside of a loop that never executes, you get no output. Within your loop at least you're trying to print to the correct filehandle.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|