|
With Win32::OLE, is it possible to pass credentials for a call to retrieve information with a GetObject? The code I'm using works fine locally, but gets access denied remotely. Everything I can find about passing credentials seems to be specific to AD or running processes, and not for GetObject. Can anyone point me in the right direction for credentials?
|
# ? Mar 22, 2011 15:33 |
|
|
# ? May 17, 2024 05:21 |
|
I already posted about this in the Linux-thread, not knowing that there's an entire sub-forum for programming. Sorry for the double-post: I'm looking for someone to write a script for my website, more info @ http://forums.somethingawful.com/showthread.php?threadid=3398004 (SA Mart). Basically the scripts needs to crawl folders of static html and randomize links and images. I pay 20 bucks.
|
# ? Mar 24, 2011 17:13 |
|
The new release of ExtUtils-MakeMaker has run into a very unexpected snag. It requires Scalar-Util, which is not core with 5.6 and thus bundles its own, in pureperl, which however breaks Compress::Zlib >V2. Since i know some people who're very well-versed in Perl have an eye on this thread, i'd like to request any input you'd be willing to give on this issue: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/4
|
# ? Mar 25, 2011 15:14 |
|
Long-time reader, first time poster for Perl help. Preface: I'm only well-versed in HTML and CSS with light understanding of Perl so far. After re-writing a trouble ticket alert system into a better designed interface, I am having trouble with the actual alert emails it sends out after checking input and determining difference between current time and when the ticket was submitted to fire off the emails to a list. The code snippet I'm having trouble with understanding is code:
The code afterward plugs the $newarr[0] and $newarr[1] into an email for ticket and priority level, but I keep hitting "uninitialized value" in the split. I've been unable to reach the original creator of this, so would anyone be able to show me where I'm loving up? Any advice would be greatly appreciated. I have not been able to find much on this elsewhere. edit: bumped the line wraps so the page doesn't stretch. edit: I know everyone hates using RegEx to remove HTML markup, but this will not be dynamic and I'm only pulling off table tags to split the columns into their own scalars.
|
# ? Mar 30, 2011 20:18 |
|
Jake Blues posted:I keep hitting "uninitialized value" in the split. Well, the first thing I would do is just throw some basic print statements in there. Before code:
|
# ? Mar 30, 2011 21:51 |
|
code:
|
# ? Mar 30, 2011 23:19 |
|
Mario Incandenza posted:
I thought that would cause it to go on in an endless loop and only break when told to break the loop. Now I have to try it too! e: Just tried it, you're right! All I can think of is that it's used to test a function that you eventually want to make a loop out of it, but just need it to temporarily run once for testing. e2: VVV I sad all I can think of, not to be confused with 'I think it's a good idea.' Winkle-Daddy fucked around with this message at 01:59 on Mar 31, 2011 |
# ? Mar 30, 2011 23:41 |
|
Winkle-Daddy posted:All I can think of is that it's used to test a function that you eventually want to make a loop out of it, but just need it to temporarily run once for testing. What the gently caress. Just do for (1) or do if that's what you need. If multiple people need to run a code snippet to figure out what it does, it probably doesn't belong in real code.
|
# ? Mar 31, 2011 00:21 |
|
I believe the infamous code fragment:code:
code:
code:
|
# ? Mar 31, 2011 04:14 |
|
What I want to know is, if you're already a perl guy, why the hell aren't you using Request Tracker for your ticketing system? Knowing some perl you can make it to do all kinds of awesome stuff.
|
# ? Apr 3, 2011 03:56 |
|
Cock Democracy posted:What I want to know is, if you're already a perl guy, why the hell aren't you using Request Tracker for your ticketing system? Knowing some perl you can make it to do all kinds of awesome stuff. Do you work with Filburt Shellbach?
|
# ? Apr 3, 2011 04:59 |
|
Anaconda Rifle posted:Do you work with Filburt Shellbach?
|
# ? Apr 3, 2011 05:48 |
|
Cock Democracy posted:What I want to know is, if you're already a perl guy, why the hell aren't you using Request Tracker for your ticketing system? Knowing some perl you can make it to do all kinds of awesome stuff. What kind of awesome stuff have you made it do? (disclaimer: I work for the company that makes it, hence Anaconda's question)
|
# ? Apr 4, 2011 00:11 |
|
Filburt Shellbach posted:What kind of awesome stuff have you made it do? (disclaimer: I work for the company that makes it, hence Anaconda's question) The scrip system is handy too. Here's an example of a special scrip we use. Our e-mail is hosted by a third party so we have to pay per-user licensing on email accounts. Therefore it's cost prohibitive to have an email account for every address going into RT. We dealt with this by giving RT one real mailbox and using forwarders for the different queues' addresses. Then we have a custom scrip that looks at the "to" address and moves the ticket into the correct queue. I realize these are kind of minor things, but what a powerful platform. My impression is that tons of great data is being collected, I just need to write more custom reports to take advantage of it. I'm looking forward to the new 4.0 release and am planning on setting it up on a test server next week. Can you share any "inside scoop" type things to look forward to?
|
# ? Apr 4, 2011 02:49 |
|
Glad to see you're making good use of RT! Lifecycles are the coolest new feature in 4.0. You can define your set of ticket statuses and transitions between them at the queue level. There's also full-text search that doesn't suck, and lots of good UI improvements like quote folding.
|
# ? Apr 4, 2011 04:09 |
|
Any OpenSSL gurus around? I'm trying to get a client-side x509 cert from Thawte working but I'm getting 'sslv3 alert certificate unknown' bubbling up through Net::SSLeay and IO::Socket::SSL. Apparently they added an intermediary certificate to their chain last year and now it seems Perl isn't properly walking up the chain of trust.
|
# ? Apr 4, 2011 23:44 |
|
Quick, what's the easiest way to take a list, edit it down to only unique entries, then sort it? Here's what I've got, but it feels inelegant.code:
syphon fucked around with this message at 00:47 on Apr 5, 2011 |
# ? Apr 5, 2011 00:45 |
|
syphon posted:Quick, what's the easiest way to take a list, edit it down to only unique entries, then sort it? Here's what I've got, but it feels inelegant. print sort map{!$}{$_}++?$_:()}@raw; Edit: depends on what you consider "elegant"... Anaconda Rifle fucked around with this message at 01:03 on Apr 5, 2011 |
# ? Apr 5, 2011 00:52 |
|
code:
|
# ? Apr 5, 2011 03:29 |
|
List::Util List::MoreUtils ffffffffffffffffffff
|
# ? Apr 5, 2011 03:33 |
|
Anaconda Rifle posted:print sort map{ !$}{$_}++ ? $_ : () } @raw; What the hell does %} (as referenced in "$}{$_}" ) do? Apparently it's a global variable (I can't declare "my $};" or "my %};") but it's so obscure it doesn't even appear in perlvar Also, why the exclamation mark? quote:print sort map { $someotherhash{$_}++ ? () : $_ } @raw;
|
# ? Apr 5, 2011 14:00 |
|
Elegance in Perl is in the eye of the beholder. My response was a joke. I would never write production code like that. The use of %} passes warnings and stricture, and has the added benefit of looking like it pairs with the { before the !. The negation was because I wanted to see a monkey in my one-liner. Why did you choose to make unique a hash reference instead of a hash? Why did you assign the value as the key instead of 1 or "This poo poo been done seen"? It's all in good fun.
|
# ? Apr 5, 2011 14:18 |
|
I get that it's silly code. I was just puzzled as to why an obvious Perl golf candidate had an extraneous character. And also: if you do code:
code:
Anaconda Rifle posted:Why did you choose to make unique a hash reference instead of a hash? I'm not sure what this means.
|
# ? Apr 5, 2011 15:55 |
|
qntm posted:I'm not sure what this means. You used $unique as opposed to %unique.
|
# ? Apr 5, 2011 16:04 |
|
qntm posted:Where, and why, is a hash named %} declared? It's not me, and it's not mentioned in perlvar as a built-in variable. Obviously, it's straightforward to populate it with stuff, but what is it supposed to be for? Very strange. In general, special variables like $_ and @ARGV are "superglobal" because package scope does not apply to them. This means you can use them in any package and they have the same value. The way this is implemented internally is (I presume) marking the globs *_ and *ARGV as superglobal. This has a side-effect of making @_ %_ $ARGV and %ARGV superglobal as well. @_ is even specialer so ignore it for now. %ARGV is populated by modules like Getopt::Whatever and is generally useful. Jifty abuses sub _ { ... } to get a superglobal function for localizing text. Functions are in stored in typeglobs too. $} is not a special variable so I don't know why it follows this pattern. Maybe an oversight, or maybe it's just because it's a punctuation variable. summary: gently caress symbol tables and gently caress type globs
|
# ? Apr 5, 2011 16:05 |
|
Anaconda Rifle posted:You used $unique as opposed to %unique. %unique{$_}++ wouldn't work. Would it?
|
# ? Apr 5, 2011 17:23 |
|
I've got another hopefully quick question. Can someone explain how escaping works when running perl expressions directly into a Windows command line using perl -e? I'm trying to run this command at a command prompt:code:
However, when I run this command, It simply errors with "'sitename)' is not recognized as an internal or external command, operable program or batch file." Obviously the command prompt is freaking out because I need to escape something (maybe the | inside the second regex? Maybe the " from my first regex?) The weird thing is, the expression works if I remove either of the two regular expressions! If I remove "$_ =~ s/\"//g;" the script works, and if I remove "if ($_ =~ /(?:Site Name|sitename)" the script works. Because of this, I don't know what character is causing the problem and how to fix it!
|
# ? Apr 5, 2011 19:22 |
|
Mario Incandenza posted:Any OpenSSL gurus around? I'm trying to get a client-side x509 cert from Thawte working but I'm getting 'sslv3 alert certificate unknown' bubbling up through Net::SSLeay and IO::Socket::SSL. Apparently they added an intermediary certificate to their chain last year and now it seems Perl isn't properly walking up the chain of trust.
|
# ? Apr 5, 2011 20:19 |
|
syphon posted:I've got another hopefully quick question. Can someone explain how escaping works when running perl expressions directly into a Windows command line using perl -e? I'm trying to run this command at a command prompt: Short version: Just don't do it. Use Cygwin if you need complex perl poo poo on the command line on windows. Long version: I'm working on fixing the DOS quoting in EUMM, among other things, and i thought i had a decent algorithm to do it. Then i stumbled across the little puzzle of how to escape %PATH%. Fixed that yesterday, two or three weeks after i found out about it. Then today i wrote a fuzzer to see if i could improve the algorithm and it's falling over literally everywhere and it's already stupidly complicated.
|
# ? Apr 5, 2011 20:30 |
|
And don't forget about escaping !PATH! if delayed expansion is turned on.
|
# ? Apr 5, 2011 22:20 |
|
Concept question here...recently we've been tightening security on a few of the command line scripts we run for various reporting and in the past we would do something like:code:
code:
Out of habit, I started writing any system command using IPC::Run, what I'm doing now though is going back and rewriting very old code to do the same.
|
# ? Apr 6, 2011 16:44 |
|
They're both right. Technically if the arguments to system() ended up containing metacharacters for whatever reason (malice, ignorance, bad luck) then it could do something dangerous, but if the scripts are not publicly accessible and the box is sufficiently locked down, then it's less of a concern.
|
# ? Apr 6, 2011 19:08 |
|
Mario Incandenza posted:They're both right. Technically if the arguments to system() ended up containing metacharacters for whatever reason (malice, ignorance, bad luck) then it could do something dangerous, but if the scripts are not publicly accessible and the box is sufficiently locked down, then it's less of a concern. Yeah, I was just getting ready to come back and edit that I found out why I've been asked to do this. Anything checked in to our SVN system gets scanned on check-in and a bug is auto filed for certain functions being used (in this case 'system') and no one thought to include those of us fixing it on the bug. Instead the people who got it just spread out the work amongst us and told us it was a "security issue." After some digging, the same security criteria for internal and external facing code review is the same; hence the alert. At least I only have a few dozen super old scripts to review, and I should be able to retire about half of them.
|
# ? Apr 6, 2011 20:08 |
|
I'm probably stupid, but perl is being weird again. FOUND IT: I changed <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> to <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -- I have a html form with the name "search". In this form I enter "é" (without quotes). I pass it to perl. There, I want to convert it to é . Sadly, perl likes to output é (é) better than é for some reasons. code:
id107 fucked around with this message at 21:23 on Apr 6, 2011 |
# ? Apr 6, 2011 20:51 |
|
I have a text file containing stuff like "abz abx aby" (among other words) and I want to match on the "ab"-part and get a list of the next character. In the above example it should produce the following: z x y I got the following code that works but I have a feeling it can be done much more effective: code:
|
# ? Apr 10, 2011 21:37 |
|
StrikerJ posted:Any suggestions or hints would be appreciated since I'm trying to learn the concepts and not only produce an acceptable result. This will extract just the matches: code:
|
# ? Apr 10, 2011 21:42 |
|
Mithaldu posted:This will extract just the matches: Just what I was looking for, thanks!
|
# ? Apr 11, 2011 21:46 |
|
I'm trying to extract names out of a tree structure and replace the labels with my own labels. The format is called newick, so this represents a full binary tree: ((A,B),(C,D)). Here's my code to get the names and make a rename map. code:
EDIT: Never mind, I figured it out. It doesn't feel very elegant, but I think it works: code:
octobernight fucked around with this message at 05:10 on Apr 22, 2011 |
# ? Apr 22, 2011 04:52 |
|
That solution does work, but I foresee problems if the existing tree already contains elements ending in "_foo", e.g. "A" and "A_foo". The existing "A" will be converted to "A_foo" on the first pass, while the existing "A_foo" will be left alone. On the second pass, you will end up with "A_foo_foo" and "A_foo_foo" respectively, which is wrong. This might work instead: code:
|
# ? Apr 22, 2011 14:13 |
|
|
# ? May 17, 2024 05:21 |
|
When did stat start returning an arrayref instead of an array? Cause every thing I can find on the internet says it'll return an array, but I have to reference before I can pull any thing out.
|
# ? Apr 22, 2011 16:16 |