Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
You say: "But no data ever seems to be there."

What do you mean by "there"? All of the commands shown will put something into the variable $database if @names had something in it to begin with.

The statement: my $database = "test.dbf"; looks like you were previously assigning a filename to $database. And that filename was then being passed to test(). Is that the case? If so, a routine expecting a filename is not going to do well if passed a string containing data instead.

You seem to be at a beginning level so we will be much more able to help you if you tell us more specifically what you are doing and what you are asking for:

  • Where did you expect the data to be after you tried the statements above?
  • What did you do that convinced you that "no data ever seems to be there"?
  • In general: what are you *actually* doing (show us the code) and what are you seeing as a result?
  • What file are you refering to when you say "
  • What does the test() routine look like?
  • Did you have any success passing the value 'test.dbf' to the test() routine (before you tried setting $database to the array value)?

NOTE: What often happens when you force yourself to *demonstrate* your problem to us instead of just reporting things like "it doesn't work" or "nothing was there" is that, in carefully laying out the specifics of your attempts you discover the solution for yourself. It's a good discipline.

P.S. Good work on using "my". Is there a "use strict" at the top of your script also? And are you using warnings?

------------------------------------------------------------
"Perl is a mess and that's good because the
problem space is also a mess.
" - Larry Wall


In reply to Re: Re: Re: using arrays insteaed of files by dvergin
in thread using arrays insteaed of files by Anonymous Monk

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 romping around the Monastery: (2)
As of 2024-06-22 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.