Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Mysql and Perl Module

by endymion (Acolyte)
on Jun 14, 2012 at 09:21 UTC ( #976158=note: print w/replies, xml ) Need Help??


in reply to Re: Mysql and Perl Module
in thread Mysql and Perl Module

Hello, I don't understand the meaning of %s ? Is this a hash ? I'm getting my information from an array. My problem is I don't know how many columns I'm getting.

Replies are listed 'Best First'.
Re^3: Mysql and Perl Module
by Anonymous Monk on Jun 14, 2012 at 09:33 UTC

    Hello, I don't understand the meaning of %s ? Is this a hash ?

    No, its a string, a format string

    If you use perl -MO=B::Deparse,-p myfile.pl to see how perl parses my code, you can see how that format string is the first argument to the sprintf function

    I'm getting my information from an array. My problem is I don't know how many columns I'm getting.

    You don't need to know, the array/code I posted knows that information, and does the right thing -- I linked a runnable example ( Re: Open multiple file handles? ) a few minutes ago in Re^3: Mysql and Perl Module

      Thank you Monk :-) I'm trying at the moment to adapt your example on my requirements. This is very helpful.
Re^3: Mysql and Perl Module
by tospo (Hermit) on Jun 14, 2012 at 09:35 UTC
    in sprintf, %s is a placeholder for a string, as in:
    $a = "world"; sprintf "hello %s", $a; # results in "hello world"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://976158]
help
Chatterbox?
[Marshall]: stevieb wish you well with water problems, my water was off all day Monday for repairs. Any more progress on .exe info problem?.
[stevieb]: Marshall: no. I commented on the thread yesterday. Visual Studio updates the tags ok, but corrupts the exe
[stevieb]: I advised the OP that a possible workaround would be to add a version function/flag that displays the required copyright/license info instead
[Marshall]: Darn! I'll look at the thread. Must not be updatinga byte count somewhere. The .exe format is a complex critter.
[stevieb]: that way, it's still "hard coded" into the exe at least, despite not being visible via Properties
[Marshall]: I also looked into PerlApp from Active State, but they don't sell their Dev Kit independent of a very expensive ($1,200) per year license anymore.
[Corion]: I would assume that the PE format hasn't changed that much since the days of yore, but it seems that I would be wrong in that assumption
[Marshall]: When I bought my copy 15+ years ago, it was just a couple hundred bucks.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2016-12-08 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (144 votes). Check out past polls.