Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.


Dave


In reply to Re: Broken Write function? Does anyone have Magic fixer ability? by davido
in thread Broken Write function? Does anyone have Magic fixer ability? by ProgrammerJutsu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found