Re: Help with recursive directory search

2004-03-17 Thread Morbus Iff
>What I need to do is look at a directory structure regardless of files.

This works for me:

  #!/usr/bin/perl
  use warnings;
  use strict;
  use File::Find;
  find(\&dirscend, "C:\\");

  sub dirscend {
  return unless -d $File::Find::name;
  print "$File::Find::name\n";
  }
If you need to work with the paths returned, you can use File::Spec.

--
Morbus Iff ( i put the demon back in codemonkey )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Spidering Hacks: http://amazon.com/exec/obidos/ASIN/0596005776/disobeycom
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Help with recursive directory search

2004-03-17 Thread Morbus Iff
>I am trying to setup a recursive read to capture every
>directory and sub-directory but seem to be hitting a wall.
Use File::Find.

--
Morbus Iff ( i put the demon back in codemonkey )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Spidering Hacks: http://amazon.com/exec/obidos/ASIN/0596005776/disobeycom
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Simple text editor under Windows

2004-03-02 Thread Morbus Iff
>So, what is a nice simple editor that will allow me to jump
>to line 187?  Note the word "simple"; if Wordpad can be made
>to do this then that would be the preferred solution.  I
>could use MS Word (Edit->Find->Go To->Line) but this seems
Try jEdit: http://jedit.sourceforge.net. It's free,
and open-source, as your Perl scripts should be.
--
Morbus Iff ( i put the demon back in codemonkey )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Spidering Hacks: http://amazon.com/exec/obidos/ASIN/0596005776/disobeycom
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Pacify user.

2003-11-25 Thread Morbus Iff
>> print "$animation[$counter++]\b";
>
>I think you got this backwards. The backslash should be before the counter,
>otherwise the animation won't look right, particularly for slower loops.
I didn't test slower loops - the above code worked
with no noticeable uglies on a dual 450mhz machine.
>> $counter = 0 if $counter == scalar(@animation);
>
>Wouldn't it have been easier (well, at least more
>succinct) to move this logic into the print statement:
>
>print "\b$animation[$counter++ % scalar(@animation)]";
It's certainly more succinct, but the book was designed as
a "teaching hospital", and that's some ugly damn code ...
(or, at least, more "compacted" and less Englishy/readable
then a "lesson" should be).


--
Morbus Iff ( i put the demon back in codemonkey )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
My book, Spidering Hacks: http://amazon.com/exec/obidos/ASIN/0596005776/
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Pacify user.

2003-11-25 Thread Morbus Iff
>So, rather than taking some 2x4 to the user, can anyone come up with a
>reliable way of printing a dot every 10 seconds, or something else that
>makes users feel all warm and fuzzy about one's scripts?
I've written about progress bars within Perl in my second book,
SPIDERING HACKS. The hack in question, happily, is freely available:
  http://www.amazon.com/exec/obidos/ASIN/0596005776/disobeycom
  http://www.oreilly.com/catalog/spiderhks/chapter/hack18.pdf
--
Morbus Iff ( i put the demon back in codemonkey )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
My book, Spidering Hacks: http://amazon.com/exec/obidos/ASIN/0596005776/
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Source-Code-Protection

2002-10-31 Thread Morbus Iff


Perl2exe <http://www.indigostar.com>http://www.indigostar.com is shareware 
but you can always use it to make executables... I use it for the same 
reason here at the office and I make sure I am the only person with access 
to the source...

That won't help you if people get your .exe. See:

 http://www.der-keiler.de/Mailing-Lists/Securiteam/2002-01/0105.html



--
Morbus Iff ( i'm the droid you're looking for )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Please Me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: AW: Source-Code-Protection

2002-10-31 Thread Morbus Iff
>Jep, I know. I like Open-Source. But sometimes there are some people
>grabbing your work and telling people its theirs... I cases like that some
>protection comes in very handy...

Yeah, but there's nothing to stop people from doing that with closed source 
either - using ResEdit on the Mac, I could take Microsoft Word, change it 
to "Morbus Types For You", and release it as my own.

--
Morbus Iff ( i'm the droid you're looking for )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Please Me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Win32::GUI or FindBin under Windows 95?

2002-10-16 Thread Morbus Iff


Has anyone had any difficulty using Win32::GUI v0.665 under Windows 95? My
current code base works perfectly under Windows 98 and up, but nothing
seems to happen (double-click, hourglass for a second, no hourglass) under
95. I've yet to do adequate testing/debugging, but I know that the last
working Win95 version I had was using .502.

Or, on the other hand, anyone know of issues with FindBin? My previous
working version was using simply "use lib ./lib", but the newest version
(again, which works everywhere on Win98 and up) uses FindBin exclusively.

The sad thing is, my only Win95 box is an old laptop - 66mhz with 8 megs of
RAM. It takes me about 15 minutes to get one response out of my
application, and it's making debugging this thing a flippin' nightmare.

Thoughts?

-- 
Morbus Iff ( shower your women, i'm coming )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Tech: http://www.oreillynet.com/pub/au/779 - articles and weblog
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: Applications written in Perl running under Windows?

2001-12-13 Thread Morbus Iff

 >> Can anyone point out any applications that were written in Perl
 >> that I can run in Windows that are not just "toys"?  I plan to
 >> try the programs under pc's without perl explicitly installed.  I
 >> would also like to know under which tools they were compiled.
 >
 >Let's see, applications written in Perl which run under Windows that are
 >not just "toys"... Well, a lot of my work is web-related, so I'll point
 >you to:

I thought he meant:

  - non-cgi-based application.
  - downloadable as normal software.
  - doubleclick to use.
  - perl not required.

??


--
Morbus Iff ( softcore vulcan porn rulez )
http://www.disobey.com/ && http://www.gamegrene.com/
please me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: Applications written in Perl running under Windows?

2001-12-13 Thread Morbus Iff

 >Can anyone point out any applications that were written in Perl
 >that I can run in Windows that are not just "toys"?  I plan to
 >try the programs under pc's without perl explicitly installed.  I
 >would also like to know under which tools they were compiled.

Arthur,

Take a look at my AmphetaDesk:

http://www.disobey.com/amphetadesk/

Which is certainly not a toy - been on TV twice, been Download of the Day a 
few places, and so on and so forth. Not only is it binaried for Windows, 
but also for Macs (pure source for Linux).

You can see my specific build instructions in the CVS:

   http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/amphetadesk/
 AmphetaDesk/docs/build.htm?rev=1.2&content-type=text/plain

Hope this helps.


--
Morbus Iff ( softcore vulcan porn rulez )
http://www.disobey.com/ && http://www.gamegrene.com/
please me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Opera and "Open Default Browser", Hard Crash?

2001-06-28 Thread Morbus Iff

 >system("c:/progra~1/opera/opera.exe $url");

Well this works perfectly fine - my problem is that there's no certifiable 
way for me to know if I should get to this point. As mentioned, I try to 
find the default browser using the Win32::API call - if Opera is set as the 
default, then shortly after the Win32::API call, my program will crash 
(because of Opera's MDI according to another subscriber).

Again, my problem is that I just blindly open the "default browser" without 
knowing what it is. If I could find out what the default browser is before 
I open it, then I can choose the right command for Opera.

Anyone know how to find out the name or path of the default browser?


--
Morbus Iff ( .sig on other machine. )
http://www.disobey.com/ && http://www.gamegrene.com/
"where's there's a will, there's a morbus ready to collect!"

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Opera and "Open Default Browser", Hard Crash?

2001-06-28 Thread Morbus Iff

I'm getting hard crashes when I use a registry check against the default
browser. The program will request the default browser (in this case,
Opera), open the browser correctly, and display the page.
Mozilla/Netscape/IE work fine, but in the case of Opera, I get a infinitely
repeatable crash as soon as the page is done loading.

I've traced the bug to something within the call to the Windows registry.
A description and workaround is below.

   a) Downloaded Opera 5.12 for Windows.
   b) Opened it up, set it as the default browser.
  That was the only configuration change.
   c) Ran my program using the following code:

use Win32::API;
my $ShellExecute = new Win32::API("shell32", "ShellExecuteA",
   ['N','P', 'P', 'P', 'P', 'I'], 'N');
$ShellExecute->Call(0, "open", $url, 0, 0, 1);

   d) Opera opened up, displayed the main page, and program crashes.

Ok. Hmf.

   c) Ran my program using the following code:

system("c:\progra~1\opera\opera.exe $url");

Opera opened up, displayed the main page, and birds sing.
The question is: why? And is there a workaround? Does the $ShellExecute
call return the path to the browser? Can I do something like:

use Win32::API;
my $ShellExecute = new Win32::API("shell32", "ShellExecuteA",
   ['N','P', 'P', 'P', 'P', 'I'], 'N');

# pseudo code below
if ($ShellExecute->Path =~ /Opera/i) {
   system("$ShellExecute->Path  $url");
} else { $ShellExecute->Call(0, "open", $url, 0, 0, 1); }

Is something like that possible?


--
Morbus Iff ( .sig on other machine. )
http://www.disobey.com/ && http://www.gamegrene.com/
"where's there's a will, there's a morbus ready to collect!"

--
Morbus Iff ( .sig on other machine. )
http://www.disobey.com/ && http://www.gamegrene.com/
"where's there's a will, there's a morbus ready to collect!"

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: Round number

2001-05-31 Thread Morbus Iff

 >I'm getting some information from my database and after some mathematical
 >operations i get a decimal number and i would like to round it...how can i
 >do that?

A lot of people will say "int! int!", but you can find a more "powerful" 
routine called "round" at the URL below. It allows you to choose what place 
you'd like to round a number to.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/sbeating/sb/sb-lib.pl?rev=1.11&content-type=text/vnd.viewcvs-markup


Morbus Iff
.sig on other machine.
http://www.disobey.com/
http://www.gamegrene.com/

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: Simple Window Creation and STDOUT Redirection?

2001-02-14 Thread Morbus Iff

>what about using Tk to manage your own window with your own buttons ?
>and you won't need to redirect STDOUT, only refresh a text widget.
>And this will run on any platform you have perl. I suppose it's

Nah, that won't work. I've thought about it - but the intended audience is
gonna get frightened if I even suggest that they need to download a 6-10meg
file (compared to the 1meg file I'd be providing) to run the program.

I've already built up various libraries for each OS - the right one is
require'd at runtime - and the Mac and PC versions will be compiled apps,
(MacPerl and Perl2Exe).

I have every intention of writing specific code for the Mac GUI and for the
Windows GUI, I'd just like something real quick so that my beta testers
don't get further annoyed at this "force quitting" that is currently
necessary for Windows...


-- 
Morbus Iff

  OXFORDMORBUS DICKTIONARY:  Ug - pronounced uh-g (hard 'g' sound)

  Verb, New Hampshire slang, meaning: 1) when one shouldn't have to thank
  another for additional services or favors rendered as part of a larger
  service arrangement but does, the proprietor responds with "Ug". Which
  is to "ug" it out, as in a comment tag in HTML code or a REM comment
  in DOS.

-08--- <\/>  <http://www.disobey.com/> --- Webster Goes to Hell ---

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Simple Window Creation and STDOUT Redirection?

2001-02-14 Thread Morbus Iff

I've been working on this script for a while, and everything runs correctly
on Mac, Windows, and Linux. The only problem is that on Windows, after you
play around with the script for a while (it's a persistant thing - doesn't
exit by itself), the DOS/Console window it opens up in *freezes*, and I
have to force-quit to close the damn thing. Windows tells me that
'winoldap' is "not responding" in the task list.

So, my question:

 I want to make a simple Win32 window.
 STDOUT should be redirected to that window.
 The window should autorefresh as new STDOUT occurs.
 The window should have a "Exit/Quit" button that cancels the script.

Any help?

-- 
Morbus Iff

()   We have SuperMorbus - able to leap tall servers in a single
   <\/>  bound, faster than a speeding packet, stronger than 128 bit
   _/\_   encryption. Defender of Truth, Justice and Devil Shat...
   Devil Shat: <http://www.disobey.com/devilshat/>

-04--- <\/>  <http://www.disobey.com/> --- Bad Ascii, Short Notice 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Re: Rounding numbers

2001-02-14 Thread Morbus Iff

>Is there a function out there that will enable me to round up a number
>i.e. 0.93495959 would become 1

I've got this one that will allow you to round to tens, hundreds, and
thousands:

##
# round()  - rounds a number to the specified degree #
##
# NOTES: #
#   Rounds a given number to the specified degree.   #
#   If no number specified, round down.  #
##
# USAGE: #
#   &round(12344.55)  #returns 12344 #
#   &round(12344.55, 1)   #returns 12345 #
#   &round(12344.43, 10)  #returns 12340 #
#   &round(12345.42, 100) #returns 12300 #
#   &round(12432.78, 1000)#returns 12000 #
##

sub round {
   # gather our data, and set defaults.
   my ($result); my ($number,$round_how) = @_;
   $round_how = 0 unless $round_how;

   # bah! uhhh... we do magical stuff here.
   if ($round_how) {
  $number /= $round_how;
  if (int($number * 2) == (int($number) * 2) + 1) {
 $result = (int($number) + 1) * $round_how;
  }
  else { $result = int($number) * $round_how; }
   }

   # just round down.
   else { $result = int($number); }

   return $result;
}

1;

-- 
Morbus Iff
  Here we have One DimensionalMorbus - Flatter than
   _   Brooke Shields, able to to be ignored for days at a time,
   slower than a Microsoft Slug. Defender of AOL users, Bill
Gates and other one dimensional life forms who mutter
  "I don't get it..."

-03--- <\/>  <http://www.disobey.com/> --- Bad Ascii, Short Notice 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users