|
vozz posted:It's supposed to generate random strings based on @dict. And I'm trying to get this to work on my web server, not the command line. Do you really want it to print out each character? Are you expecting it to return a value? Each letter it generates is immediately printed out, and not returned. You could just add: code:
What I mean by this is that "my $password = randPw(7)" would assign the length of the returned array to $password, which is the number 7. Here's a slightly less verbose implementation, that uses the same "iterate through the allowed characters" idea: code:
fansipans fucked around with this message at 19:40 on Dec 10, 2007 |
# ¿ Dec 10, 2007 19:37 |
|
|
# ¿ May 2, 2024 05:40 |
|
SpeedFrog posted:It might also be a symbolic reference: Also if you're using strict and warnings as you should at the top of every file: code:
code:
|
# ¿ Jan 28, 2008 16:40 |
|
I'll second SpeedFrog's recommendation of DBIx::Class. I started with Class:: DBI but got frustrated with the lack of features / extensibility / plugins available. I've heard Rose:: DB is a screamer, but haven't gotten around to taking a look at it. DBIx::Class has many hooks and a great selection of third party plugins for profiling & debugging & adding new features. It's also got great support for the basics of database / object relationships (belongs_to, may have, has_one, has_many, many_to_many).
|
# ¿ Apr 17, 2008 15:37 |
|
GregNorc posted:
The code above works fine in OSX 10.4 for me. Also there's no reason to prefix sub names with &. fansipans fucked around with this message at 11:58 on Apr 28, 2008 |
# ¿ Apr 28, 2008 11:39 |
|
LightI3ulb posted:HELP! Always, always, always include these two lines: code:
|
# ¿ May 14, 2008 13:53 |
|
Triple Tech posted:You can also use print Data::Dumper $structure. Triple Tech nailed it on the head: Data::Dumper is your super number 1 friend: code:
|
# ¿ Jun 10, 2008 01:30 |
|
mister_gosh posted:How can I NOT store the path for the files I put in a zip archive? From the Archive::Zip documentation, it appears that addFile will also accept a new name for the file once it's added. Keep in mind "filename" for zips includes their path, so you should be able to do: code:
code:
|
# ¿ Jun 19, 2008 13:56 |
|
Mithaldu posted:I have literally been looking for advantages of it over the past two weeks and aside from it being a different syntax (which is a disadvantage for me) i have found exactly none. It being slower than for only drives the nail in its coffin of uselessness for me. It makes code a hell of a lot more readable ... code:
|
# ¿ Nov 18, 2008 15:18 |
|
Mithaldu posted:Not to me. Looks more like perl golf than anything else. That reminds me of learning Spanish back in High School. There were kids who did all their homework, memorized every word in the book, and got straight A's. But when it came time for spoken exams, you'd see their eyes roll up to the ceiling, and the words come out one at a time. Then there were a few kids that could flip a switch, and speak almost entirely in Spanish. They'd often have a few pet phrases that they'd incessantly discuss in a variety of situations. Mine was "vaca", the word for cow. "The cow has gone to the police station to complain about the loud children and their annoying cars", "The drunken cow sang a song using the broccoli as a microphone", etc. These kids would accidentally keep speaking Spanish when they left class. They might not remember the word for brakes on a car, but instead they'd just say "la machina para hacer parar" (the machine to make to stop) Both types of student could certainly survive if stranded in Madrid or Mexico City, but the latter would probably have much more fun
|
# ¿ Nov 18, 2008 16:13 |
|
EVIR Gibson posted:What does the following mean. I knew it had to do something with a key->value or perhaps a method but the second line I am not getting. The first one is a method call on a blessed object. The method called is "b", and the package this looked up under is the package that the object $a was blessed with. See the Method Invocation section of perlobj. The second one is accessing the key "b" from the hash reference $a.
|
# ¿ Nov 21, 2008 19:12 |
|
SpeedFrog posted:Best practices for global configuration data? I'm leaning towards handing out a JSON struct via REST, as it's a fair bit quicker than reading a file off disk and doesn't go stale as easily. Am starting to feel the pain of redundant configuration files. Global configuration data in what context? What needs configuration? (Perl Questions -> JSON -> REST )
|
# ¿ Dec 8, 2008 19:44 |
|
|
# ¿ May 2, 2024 05:40 |
|
Sartak posted:DBIx::Class seems to be the latest and greatest. It's the most actively developed and maintained. Seconded. It's got very comprehensive documentation too. I've also heard good things about Rose::DB
|
# ¿ Jan 15, 2009 00:28 |