Its been a long time since i've had to hack some code together so here just asking for advice as to where to start.
I have a group of printers (all have same web interface) on the corporate network. I would like to make a simple script that can login, and upload a config file (really its a list of users that have can scan documents, it doesn't matter what).
I've tried to google this with limited results, so wanted to reach out here to see if PERL would be the best answer for this.
I guess my question is, what modules should I look at to connect to a webpage in order to login then access a page behind the login and upload a file?
I looked into Mechanize but I do not believe it can handle javascript. Any advice or test scripts that do something similar would be greatly appreciated.
submitted by /u/hsvodka
[link] [comments]
I’m currently having to modify a library that used Smart::Match extensively since I can no longer turn off the zillions of lines of experimental warnings in recent Perls. For people who are in a similar situation it’s looking like Data::Compare can replace the situations where I was doing ‘@foo ~~ @bar’, and it’s easy enough to write a “does this hash have this key” helper.
Meta complaint: I was already a bit annoyed at the whole smartmatch “oh whoops actually this is now experimental” saga but now that I’m stuck fixing this breakage I’m $annoyed++. Im getting annoyed enough that I may choose an older Perl that was “good enough” and just stop using the new ones
See also: https://www.reddit.com/r/perl/comments/pimwma/how_do_i_stop_smartmatch_is_experimental_at/
submitted by /u/lovela47
[link] [comments]
Hello all I have a .pl CGI program that calls a module with lots of code I'll call it LotsOfCode.pm now I need to update a few subs in it and possibly add a dependency.
The pl file looks like this:
use LotsOfCode;
Lotsofcode->cat();
LotsOfCode->dog();
Lotsofcode->fish();
Now I'd like this to say the same but I need to improve fish and cat. Say LotsOfCode.pm looks like this:
package LotsOfCode
sub fish {}
sub dog {}
sub cat {}
1;
I'd like to
mkdir ./LotsOfiCode
nano LotsOfCode/fish.pm move sub fish{} here
nano LotsOfCode/dog.pm move sub dog {} here
nano LotsOfCode/cat.pm move sub cat {} here
what do I put in the top of these new files in \LotsOfiCode ?
package LotsOfCode::fish;
or
package fish; ?
or
nothing is what I have so far just
sub fish {}
then in LotsOfCode.pm
do I go:
package LotsOfCode
use LotsOfiCode::fish
use LotsOfiCode::dog
use LotsOfiCode::cat
1;
or
do LotsOfCode::fish;
do LotsOfCode::cat;
do LotsOfCode::dog;
Thank you all in advance I get the more than one way to do it idea of Perl but feel like I keep fumbling with mixing old and new code.
submitted by /u/bug_splat
[link] [comments]
submitted by /u/EvanCarroll [link] [comments] |
Why is "!!" considered bad form in Perl?
During a recent job interview process, I submitted some sample Perl code which used the so-called "secret" !! operator. Later, when discussing the code, one of the interviewers asked me why I chos...Stack Overflow
Filed under "Things that one can do, but why?" , here is the repo of using Perl to learn assembly, or rather use Perl to avoid
- having a C driver program
- make files
- multiple files (Inline::ASM allows one to keep Perl and Assembly in the same file
Bonus :
- it is insane how efficient some of the list utilities at List::Util are !
- Seems Github uses file extensions to count lines of code in a language (the repo is considered all Perl
Link https://github.com/chrisarg/perlAssembly
submitted by /u/ReplacementSlight413
[link] [comments]
GitHub - chrisarg/perlAssembly: Examples of using Perl to augment NASM and vice versa
Examples of using Perl to augment NASM and vice versa - chrisarg/perlAssemblyGitHub