Re: perl OOP question

2003-06-24 Thread Brad Baxter
On Mon, 23 Jun 2003, David Christensen wrote: > I've built a some classes (eg: ILLString) which live in ./ISO/types > The class "header" is: Package ISO::types::ILLString > > Everything in my test program works fine if (in the top-level directory) I > say: > > use ISO::types::ILLString; > my $s

Re: perl OOP question

2003-06-25 Thread Brad Baxter
On Tuesday 24 June 2003 03:51 pm, Andy Lester wrote: > >Whether you use the "indirect object" form of method call as you're doing > >above, or the "object-oriented" form, the class name determines where Perl > >will find the new() method. Since there isn't a class named literally > >"ILLString", P

Re: taint this!

2003-10-27 Thread Brad Baxter
John, Without attempting to answer your question (because I'm not sure I fully comprehend the situation), you may also want to read the `perldoc perlsec` security documentation. It has a paragraph specifically about insecure paths. Not sure it's the answer for you, but it might be. Regards, Br

Re: Updating an array

2003-10-30 Thread Brad Baxter
On Thu, 30 Oct 2003, Michael Bowden wrote: > I read in an array from a file. It looks something like this: > > 200044455669,,abcdefg,777,f00,f00,f00,f00,a01,b23,c45,d00,e10,no,no,no,no,no, > 200011122333,,hikls,223,f32,f43,f00,f00,a04,b06,c08,d03,e09,no,no,no,no,no, > mrgreenjeans,,pqrstu

Re: Caution Newb Toes The Dirt...

2003-11-13 Thread Brad Baxter
On Thu, 13 Nov 2003, paul POULAIN wrote: > You will say : "hay, but i still need to login. And i don't need login". > > I'll answer => ok, go to : Koha >> Parameters >> System preferences >> > insecure >> set to "1" (or "yes", not sure), > and it's done => no more auth check :-) > > And you have a

Re: Caution Newb Toes The Dirt...

2003-11-13 Thread Brad Baxter
On Thu, 13 Nov 2003, paul POULAIN wrote: > Brad Baxter wrote: > > >On Thu, 13 Nov 2003, paul POULAIN wrote: > >>You will say : "hay, but i still need to login. And i don't need login". > >> > >>I'll answer => ok, go to : Koha >>

Re: MARC::Record ordering of fields

2005-05-13 Thread Brad Baxter
On Fri, 13 May 2005, Leif Andersson wrote: > How would you do to re-order the fields in a MARC::Record-record? > > I just needed that kind of thing and after some struggeling came up with: > > @{$record->{_fields}} = > sort { > lc($a->{_tag}) cmp lc($b->{_tag}) >} >

Re: MARC::Record ordering of fields

2005-05-14 Thread Brad Baxter
On Sat, 14 May 2005, Bruce Van Allen wrote: > If you haven't seen it, you might be interested in the "packed-default" > sort described by Uri Guttman and Larry Rosler, and now usually refered > to as the Guttman-Rosler sort. For their original paper, see: >

RE: Separating index terms

2005-05-31 Thread Brad Baxter
On Tue, 31 May 2005 [EMAIL PROTECTED] wrote: > Amin, > > This should do the trick: > > my @keywords = split(/[<>]+/,$keywords ); > > Ian Or, my @keywords = $keywords =~ /<([^>]+)>/g; Regards, Brad

Re: MARC-8 to UTF-8 conversion

2005-12-05 Thread Brad Baxter
On 12/5/05, Doran, Michael D <[EMAIL PROTECTED]> wrote: > > > For those who aren't familiar with the MARC 21 alternate character set > repertoires (specifically, the East Asian ideographs), by "largish", Ed > is talking on the order of a table containing upwards of 16,000 > mappings. > > Am I right

Re: MARC-8 to UTF-8 conversion

2005-12-05 Thread Brad Baxter
On 12/5/05, Ed Summers <[EMAIL PROTECTED]> wrote: > > On 12/5/05, Doran, Michael D <[EMAIL PROTECTED]> wrote: > > So... this is all very interesting (and I've definitely learned > > something here), but like I suggested previously, this level of digging > > may be a bit beyond the "casual" Perl

Re: MARC-8 to UTF-8 conversion

2005-12-05 Thread Brad Baxter
On 12/5/05, Ed Summers <[EMAIL PROTECTED]> wrote: > > > Am I right that this amounts to less than 1Meg (EastAsian.db + > > UTF8.db)? Depending on your system and your needs (more > > speed?), that may not be considered large and might fit into > > memory fine. Otherwise, I think any of the in-core

Re: MARC-8 to UTF-8 conversion

2005-12-06 Thread Brad Baxter
I hope it's as simple as that. I don't have first-hand experience doing what you are, i.e., building the dbm file at install time for access at run time. -- Brad On 12/5/05, Edward Summers <[EMAIL PROTECTED]> wrote: > > On Dec 5, 2005, at 8:33 PM, Brad Baxter wrote: >

Re: New version of Tk::MARC_Editor

2006-01-06 Thread Brad Baxter
On 1/5/06, David Christensen <[EMAIL PROTECTED]> wrote: > > ... Any thoughts on CPAN namespace stuff? I > don't suspect that anyone is using Tk::MARC... should I rename > Tk::MARC_Editor to that (you can't just use one as a drop-in replacement > for > the other, though... so maybe not). > > As al

Re: New version of Tk::MARC_Editor

2006-01-08 Thread Brad Baxter
David, Just quick followup. I don't have a particularly strong opinion about the namespace, and your argument makes sense. In any case, a search at cpan.org for either seems to find it. Cheers, Brad On 1/6/06, David Christensen <[EMAIL PROTECTED]> wrote: > > Thanks for the comment, Brad. > >

Re: dereferencing an array - Pt 2

2006-02-11 Thread Brad Baxter
Short answer: $profit{ $facet }{ $term }{ $resource } = $url; Example: #!perl use strict; use warnings; use Data::Dumper; $Data::Dumper::Terse++; $Data::Dumper::Indent--; my %profit; while( ) { chomp; my( $resource, $url, $term, $facet ) = split /,/; $profit{ $facet }{ $term }{ $res

Re: Deleting a subfield using MARC::Record

2006-05-01 Thread Brad Baxter
+1 But I have some questions: On 4/30/06, Edward Summers <[EMAIL PROTECTED]> wrote: [snip] So effectively there is AND boolean logic between any options that are supplied. If this looks good I've got some code that does it and some tests committed in SourceForge for you to take a look at [1]. I

Re: Deleting a subfield using MARC::Record

2006-05-01 Thread Brad Baxter
On 5/1/06, Bryan Baldus <[EMAIL PROTECTED]> wrote: On Monday, May 01, 2006 1:24 PM, Brad Baxter wrote: >On 4/30/06, Edward Summers <[EMAIL PROTECTED]> wrote: >[snip] >> # delete first two subfield u >> $field->delete_subfield(code => 'u', count =&

Re: Deleting a subfield using MARC::Record

2006-05-02 Thread Brad Baxter
On 5/1/06, Edward Summers <[EMAIL PROTECTED]> wrote: On May 1, 2006, at 1:24 PM, Brad Baxter wrote: >> # delete first two subfield u >> $field->delete_subfield(code => 'u', count => 2); > > I don't think I like it this way. How would you delet

Re: Deleting a subfield using MARC::Record

2006-05-03 Thread Brad Baxter
On 5/3/06, Michael Kreyche <[EMAIL PROTECTED]> wrote: The term "position" ("pos") seems a little ambiguous to me on the face of it. Does (code => 'u', pos => 0) mean "the first subfield u" (which is what I take it to mean) or "subfield u if it's the first subfield" (which it might sound like ou

Re: Stripping out Unicode combining characters (diacritics) -

2008-05-07 Thread Brad Baxter
Just to throw this out there: you may be interested in Text::Unidecode (http://search.cpan.org/~sburke/Text-Unidecode-0.04/) if your ultimate goal is to try to represent a unicode character with its closest ascii (or perhaps I should say, "romanized") equivalent. -- Brad On Wed, May 7, 2008 at 9:

Re: Problem installing MARC::Record 2.0.0 under perl 5.8.0

2008-07-08 Thread Brad Baxter
On Tue, Jul 8, 2008 at 4:11 PM, Christopher Morgan <[EMAIL PROTECTED]> wrote: > So there is hope! But, yes, I see the need to get to 5.8.2 asap! > or 5.10.0 :-)

Re: Moose based Perl library for MARC records

2010-11-11 Thread Brad Baxter
2010/11/11 Frédéric DEMIANS : > Thanks all for your suggestions. I have to choose another name for sure. > Marc::Moose seems to be a reasonable choice. But I'm very tempted by a > shorter option: MarcX, MarcX::Record, MarcX::Parser, MarcX::Reader::Isis, > etc. Any objection? > I can't think of a b

Re: MARC-in-JSON in MARC::Record

2011-01-18 Thread Brad Baxter
When I wrote Data::Pairs (http://search.cpan.org/dist/Data-Pairs/), I had JSONified MARC in mind. To my mind, a data structure that is a "Pairs of Pairs"[2] would faithfully represent a MARC record, including preserving the orders of fields/subfields. Below is the short example from [1] displayed

Re: MARC-in-JSON in MARC::Record

2011-01-18 Thread Brad Baxter
On Tue, Jan 18, 2011 at 9:14 AM, Brad Baxter wrote: > that those algorithms might be the basis for a similar JSON library. I meant, javascript library.

Re: MARC-in-JSON in MARC::Record

2011-01-18 Thread Brad Baxter
On Tue, Jan 18, 2011 at 10:43 AM, Galen Charlton wrote: > Hi, > > On Tue, Jan 18, 2011 at 10:15 AM, Smith,Devon wrote: >> I think it's a mistake to get hung up on the leader being "next to" the >> fields or the indicators being "next to" the subfields. The leader and >> indicators aren't really d

Re: Introducing Marc::Loader

2011-02-08 Thread Brad Baxter
Hello, I wonder why the hash structure you're proposing doesn't match the MARC-in-JSON proposal, http://dilettantes.code4lib.org/blog/2010/09/a-proposal-to-serialize-marc-in-json/ At first glance, it looks to me that your structure can't retain the order of fields or subfields. I realize that i

Re: MARC-in-JSON in MARC::Record

2011-02-09 Thread Brad Baxter
Hi all, In an effort to put my money where my mouth is regarding my remarks about MARC-in-JSON vis-a-vis a Pairs version, I've uploaded some modules under the MARC::Utils namespace: http://search.cpan.org/dist/MARC-Utils-MARC2MARC_in_JSON/ http://search.cpan.org/dist/MARC-Utils-MARC2Pairs/ http:/

Re: MARC-in-JSON in MARC::Record

2011-02-10 Thread Brad Baxter
On Wed, Feb 9, 2011 at 5:29 PM, Galen Charlton wrote: > The MARC::File::JSON module is consistent with other MARC::File::XXX > modules that handle serializing and deserializing MARC::Record > objects. > > MARC::Utils::MARC2Ini is an interesting concept, but it wouldn't take > much work to recast i

Re: MARC-in-JSON in MARC::Record

2011-02-12 Thread Brad Baxter
Feb 10, 2011 at 9:19 AM, Galen Charlton wrote: > Hi, > > On Thu, Feb 10, 2011 at 9:06 AM, Brad Baxter wrote: >> I had also thought about how to separate JSON records in a single file. >> Perhaps this has been solved already, but I haven't seen a reference >>

Re: Finding all the Perl books

2011-11-11 Thread Brad Baxter
On Fri, Nov 11, 2011 at 11:06 AM, Bob Paver wrote: > Has anyone suggested asking this question on the Perl Monks site? Lots of > true Perl diehards on that site. I resemble that remark. :-)

Re: File open head scratcher UPDATE

2012-03-17 Thread Brad Baxter
ppend to > it.  I'm running the script now to check for any unintended consequences. > > My take-away on this, is to avoid the use of "+>>" to open a file.  In fact, > in doing further research I saw that exact advice in the Perl Cookbook, and > for just this rea

Re: send emails via perl

2014-11-19 Thread Brad Baxter
This might answer that: http://perldoc.perl.org/perlfaq9.html#How-do-I-send-email%3f On Wed, Nov 19, 2014 at 3:30 AM, Sergio Letuche wrote: > hello, > > we need to use the easiest solution, if possible just use a perl module, > to be able to send automated emails on an Ubuntu server. The scenar

Re: split a huge json file in separate per object files

2017-03-10 Thread Brad Baxter
#!/usr/bin/perl use strict; use warnings; use JSON; # version 2.90 my $hash = from_json( test_json_string() ); for my $key ( keys %$hash ) { my $filename = sprintf "%.06d.json", $key; my $subhash = $hash->{ $key }; open my $fh, '>', $filename or die "Can't open $filename: $!"; pr