|
welcome to hell posted:Even among the IRC crowd you aren't going to see a lot of consistency on style preferences for minor things like this.
|
# ? Aug 14, 2015 03:23 |
|
|
# ? May 15, 2024 04:39 |
|
welcome to hell posted:Even among the IRC crowd you aren't going to see a lot of consistency on style preferences for minor things like this. For the parens, yeah, no real concencus. Too many C devs who associate () with function call. For the intermediate arrow though, there is concensus. Generally only those who don't know about its optionality leave it in.
|
# ? Aug 14, 2015 12:18 |
|
Mithaldu posted:A true perler also has a sense of humor. I don't know, in my experience people who like Perl are pretty defensive about it. welcome to hell posted:Even among the IRC crowd you aren't going to see a lot of consistency on style preferences for minor things like this. Style inconsistency? In a programming language whose core design principle was "There should be multiple redundant ways to do literally everything"? Well, I never.
|
# ? Aug 14, 2015 18:37 |
|
Mithaldu posted:For the intermediate arrow though, there is concensus. Generally only those who don't know about its optionality leave it in. I didn't know about this. So, dereferencing arrows are optional precisely when?
|
# ? Aug 14, 2015 19:12 |
|
Sebbe posted:I didn't know about this. So, dereferencing arrows are optional precisely when? $hash->{shoop}->{da}->[5]->{woop}->[9]->{etc} Only the first one is needed here. qntm posted:I don't know, in my experience people who like Perl are pretty defensive about it. qntm posted:Style inconsistency? In a programming language whose core design principle was "There should be multiple redundant ways to do literally everything"? Well, I never. Mithaldu fucked around with this message at 20:15 on Aug 14, 2015 |
# ? Aug 14, 2015 20:13 |
|
Mithaldu posted:Inbetween any of these cases: [][], []{}, {}{}, {}[], and any repeats of [] or {} after those. This exists because nobody wants to read the arrow everytime when the code tries to go 6 levels deep into a complex structure, aka: I'm certainly not at the level of many in terms of perl mavenhood or whatever, but, I honestly don't mind looking at the arrows in any way. It's also slightly less confusing to not ever have to wonder do I need an arrow here or not.
|
# ? Aug 14, 2015 21:35 |
|
toadee posted:I'm certainly not at the level of many in terms of perl mavenhood or whatever, but, I honestly don't mind looking at the arrows in any way. It's also slightly less confusing to not ever have to wonder do I need an arrow here or not. If you're very early on in your Perl, or never read any of the perl documentation, or simply learned from a not-so-great tutorial found via google, then it might seem confusing, but to the vast majority of perl people it's second nature to omit them, for sheer convenience for the future reader, and themselves.
|
# ? Aug 14, 2015 22:10 |
|
I mean does the arrow confuse you or something?
|
# ? Aug 14, 2015 23:52 |
|
toadee posted:I mean does the arrow confuse you or something?
|
# ? Aug 15, 2015 00:14 |
|
Mithaldu posted:It slows down the reader, as well as the writer, without providing anything positive. It provides consistency, and if there were a decent IDE it would just be written for you. Also I believe given the way humans read it doesn't slow that down at all either. Really I just have a problem with people getting all butthurt over trivial bullshit. If you don't want to use them, great. It's not like it's actually a negative factor in any way other than your own mind and preference. This kind of poo poo is what actually makes people hate asking for programming advice on the internet.
|
# ? Aug 15, 2015 00:17 |
|
toadee posted:butthurt over trivial bullshit
|
# ? Aug 15, 2015 00:22 |
|
Well helpful hint, if you want to offer a constructive tip, just be like 'hey, cool thing to note: you can actually skip the arrows after the first one, if you like the readability/ease of typing better'. Instead of a mini diatribe over idiosyncratic perl and proper convention.
|
# ? Aug 15, 2015 00:26 |
|
toadee posted:idiosyncratic
|
# ? Aug 15, 2015 00:33 |
|
Speaking of barcodes, does anyone have experience using Perl to generate barcodes? I'm tackling a project at work where the goal is to take a text file that contains a Name and Account Number, and to generate a tiff image that contains the Name, the Account Number, and a barcode (generated from the Account Number). I'm 99% sure the barcode standard for this is Code39.
|
# ? Aug 15, 2015 02:54 |
|
No experience myself, but there are a few modules: https://metacpan.org/search?q=code39
|
# ? Aug 15, 2015 03:01 |
|
Hughmoris posted:Speaking of barcodes, does anyone have experience using Perl to generate barcodes? I'm tackling a project at work where the goal is to take a text file that contains a Name and Account Number, and to generate a tiff image that contains the Name, the Account Number, and a barcode (generated from the Account Number). code:
|
# ? Aug 15, 2015 21:27 |
|
Mithaldu posted:No experience myself, but there are a few modules: https://metacpan.org/search?q=code39 Thanks, the PDF::ReportWriter looks promising. John Big Booty posted:Great stuff... Wow, thank you for taking the time to write that up. I'm going to give it a shot and I'll let you know how it turns out.
|
# ? Aug 16, 2015 01:53 |
|
Hughmoris posted:Thanks, the PDF::ReportWriter looks promising. If ReportWriter doesn't quite fit your needs, it's PDF::API2 does all the heavy lifting and allows for more granularity. Keep in mind, though, that in PDFs, 0,0 is the bottom left. Also, you'll probably have to factor in the ascender/descender of the font. PDF can be a pain in the rear end.
|
# ? Aug 16, 2015 03:47 |
|
John Big Booty posted:No problem. I used to do quite a bit of work with ImageMagick, so it wasn't much of a stretch. Just to follow up, your ImageMagic script worked like a champ after a tweaking it a little bit to fit my scenario. Thanks for that. Now, I'm getting tripped up on something simple. I'm trying to parse a ' | ' delimited file. code:
Perl code:
code:
|
# ? Aug 21, 2015 00:23 |
|
Hughmoris posted:Just to follow up, your ImageMagic script worked like a champ after a tweaking it a little bit to fit my scenario. Thanks for that. First argument on split is a pattern, right? So it's treating that '|' as an "or" with two empty sides so everything matches and it gets split on every character? So '\|', maybe?
|
# ? Aug 21, 2015 00:32 |
|
Toshimo posted:First argument on split is a pattern, right? So it's treating that '|' as an "or" with two empty sides so everything matches and it gets split on every character? So '\|', maybe? Doh! I knew I was missing something simple. Thanks!
|
# ? Aug 21, 2015 00:35 |
|
I'm on the tail end of a work project, and am a bit stumped on what should be the easiest part. At the end of my program, I end up with a .tif file. I want to transfer that .tif file to a \\server\filepath. What is a secure way to provide my script a \\server\filepath in addition to the username and password for the server, then securely transfer the .tif file? I'm learning Perl as I go, so I may be missing something simple here. *Perhaps something like Net::SCP::Expect? Hughmoris fucked around with this message at 01:13 on Aug 28, 2015 |
# ? Aug 28, 2015 01:11 |
|
Hughmoris posted:I'm on the tail end of a work project, and am a bit stumped on what should be the easiest part.
|
# ? Aug 28, 2015 06:24 |
|
I thought I'd share a small tool I find useful: perlopen It's basically just a small script that searches your include path for a specific package, and opens it in your editor. E.g. perlopen WWW::Mechanize Saves you some time from searching for the file if you want to, say, inspect the source of an installed CPAN module or whatnot.
|
# ? Aug 28, 2015 09:18 |
|
John Big Booty posted:Is SSH running on the target machine? I don't have control of the target machine but I'm being told no, it doesn't have SSH. I want to say it runs some version of Windows Server, and the Perl script will be running on a Windows 7 computer running Strawberry Perl.
|
# ? Aug 29, 2015 00:40 |
|
Hughmoris posted:I don't have control of the target machine but I'm being told no, it doesn't have SSH. I want to say it runs some version of Windows Server, and the Perl script will be running on a Windows 7 computer running Strawberry Perl.
|
# ? Aug 29, 2015 01:33 |
|
John Big Booty posted:Not really a windows guy, but try this: http://migo.sixbit.org/software/smb-perl/ Ended up just mapping the network drive by utilizing NET within the Perl script, then disconnecting the drive when file finished transferring. For a script that would be running 24/7, and transferring up to 50 files a day I'm not sure if this is the best long term solution. Ideally, the computer running the script just stays mapped to the network drive but the server-owner is wary doing that, not sure why.
|
# ? Sep 3, 2015 01:22 |
|
I stumbled upon this tutorial on how to do a basic scrape of Craigslist. As a learning exercise, I want to try and do something similar with Perl. If you look at that link, Python has a slick way of accumulating all of the information and placing it in a neat table and graphing off it. Does Perl have something similar, or am I better off just copying it to an excel spreadsheet? Here's what I have so far. It calls the webpage, scrapes the listing data, and sorts it by price. Its pretty neat how easily Perl sorts an array of hashes. Perl code:
Hughmoris fucked around with this message at 06:57 on Sep 14, 2015 |
# ? Sep 14, 2015 03:29 |
|
I've never done that kind of ad-hoc rendering, but you can maybe do it with PDL: http://pdl.perl.org/ http://pdl.perl.org/?page=demos/plot2D
|
# ? Sep 15, 2015 09:22 |
|
toadee posted:I'm certainly not at the level of many in terms of perl mavenhood or whatever, but, I honestly don't mind looking at the arrows in any way. It's also slightly less confusing to not ever have to wonder do I need an arrow here or not. You could just never use arrows! No confusion! $$hash{shoop}{da}[5]{woop}[9]{etc}
|
# ? Oct 14, 2015 21:06 |
|
This may not be the appropriate place to ask this question, but I'm hoping to get the opinion of those familiar with Perl, rather than just basic troubleshooting. I have an application that is not launching. When attempting to do so from the command prompt, I receive an error message: "Error: Can't locate perl58.dll Make sure the ActivePerl bin directory is in your PATH" This application does not require an underlying installation of ActivePerl. Normally it will create a folder under "Username\AppData\Local\Temp\pdk-UserName-####" (seemingly random, four digit number), with perl58.dll in that folder, after which, I am assuming it would use that dll as the Perl interpreter. Currently, it does create the folder in the temp directory along with perl58.dll, it just doesn't get any further than that. So it seems like it is creating perl58.dll in the location it should, but is failing to read it. I am at a loss what to try to correct this and am running out of time. I've tried some stupid things (installing ActivePerl, manually putting perl58.dll somewhere and adding the location to PATH), but nothing has worked or provided any clues so far. I've backtracked looking at every change that has been done to the system since the application was last working and I feel I've eliminated every possibility that makes any sense at all. Unfortunately, I can't really go in to many details regarding the application...Is anyone familiar with this method of packaging and have any ideas what could cause it to screw up like this?
|
# ? Oct 20, 2015 20:41 |
|
You want to download this program: https://technet.microsoft.com/en-us/library/bb896645.aspx?f=255&MSPPError=-2147217396 Run it, then try and start your software, then pause it and check the log to see where it's trying to read that dll in.
|
# ? Oct 20, 2015 21:17 |
|
Access protection - McAfee antivirus. Figures it was something stupid I overlooked. Thanks. It didn't provide the direct solution, but it did point me in the right direction.
|
# ? Oct 21, 2015 16:21 |
|
Now that Perl 6 has been released, anyone been messing around with it?
|
# ? Jan 7, 2016 13:50 |
|
What do you want to know about it?
|
# ? Jan 7, 2016 16:35 |
|
Hughmoris posted:Now that Perl 6 has been released, anyone been messing around with it? I've only been messing about with Perl 6 so that I can lambast its design on a superficial level.
|
# ? Jan 7, 2016 19:18 |
|
gently caress the mods posted:What do you want to know about it? Just curious what people thought of it, and if you're currently using it for anything. I've rewritten a couple of small scripts for work in Perl 6, and I'm enjoying the language so far but I'm a beginner so I'm sure I'm just skimming the surface of the language.
|
# ? Jan 7, 2016 22:20 |
|
I'm too old to learn new syntax. Perl5 for life!
|
# ? Jan 8, 2016 00:35 |
|
Hughmoris posted:Just curious what people thought of it, and if you're currently using it for anything. I've rewritten a couple of small scripts for work in Perl 6, and I'm enjoying the language so far but I'm a beginner so I'm sure I'm just skimming the surface of the language. I've got my share of gripes but I still like it. I also contribute to the core regularly and do some contract work with it. Some of the good stuff: Cross platform IO stuff (class IO::Path) Threads/async stuff Lazyness NativeCall (no more XS hell) Math stuff (although I can't comment much on this) Dashes in variable names (also Unicode characters) Grammars (To me this is the killer feature) Essentially has its own version of Moose built in Some of the bad stuff: You can't pass data from an IO handle (Socket, File) from one thread to another (LOL. The reason is because it uses a scheduler per thread and libuv doesn't like that or something). So you aren't going to be doing much of stuff like handling web requests in one thread and reading them from another. The first time a module is used it precompiles it so script startup time is slower the first time you run a script (a rather new thing from a rushed "upgrade" before release, which to me is unacceptable) I guess the REPLs suck (I don't use them so I wouldn't know) Flattening lists/arrays can sometimes be ugly and confusing for a beginner The ecosystem (its full of XXX ported from Perl 5 !! without using idiosyncratic Perl6 [and usually without understanding the code they ported to begin with], the majority of other modules are just small things you'd probably prefer to write yourself due to the large feature set of the language itself, people putting authoring dependencies inside their depends due to bad advice from self promoters... I could go on here but im biased so i'll stop) Slow, CPU/Memory use The community could be seen as good or bad. You can easily talk to larry, and there are quite a few other people who are extremely knowledgeable that are usually available. At the other end theres an influx of users who know just enough to give themselves an ego larger than their skill level, so you need to do a lot of cutting through the noise of people promoting themselves instead of teaching (i've never seen so much "well I did xxx with my module yyy" when referring to every little thing"). All the core developers are great though. I know its been like a million years since it was announced, but if it had just 1 more year I think it would have been for the best. The current release is called '6.c', and there are already breaking changes for a version '6.d' along with other breaking changes that need to be made. On the plus side there are some more features to be added that didn't make it yet (like the double pointed pipe operator; my @x = 1,2,3; my @y = 3,4,5; my @z; @x ==> @y ==>> @z)
|
# ? Jan 8, 2016 02:47 |
|
|
# ? May 15, 2024 04:39 |
|
gently caress the mods posted:I've got my share of gripes but I still like it. I also contribute to the core regularly and do some contract work with it... Thanks for taking the time to type that up. Even though I'm a beginner programmer who mainly does it as a hobby, I really hope Perl 6 takes off. With all the time and effort that I'm sure has gone into it over the past 15+ years, I hope it gets an honest shake.
|
# ? Jan 8, 2016 03:04 |